From 8752354fa9b2b8c03b47b33a75e0ca95e8335d97 Mon Sep 17 00:00:00 2001 From: Julie Lala Date: Tue, 18 Aug 2015 08:41:40 -0400 Subject: check if changed before autouploading, hide filetool, other stuff.. --- js/clipboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/clipboard.js') diff --git a/js/clipboard.js b/js/clipboard.js index 7e683dc..a7dc8f6 100644 --- a/js/clipboard.js +++ b/js/clipboard.js @@ -122,7 +122,8 @@ var clipboard = (function () { lex.build() } } - + + current_filetool && current_filetool.blur() }, import_text: function () { -- cgit v1.2.3-70-g09d2 From 7c644c07e6f4ecc78f5a9faec3bbd88b6f9602e8 Mon Sep 17 00:00:00 2001 From: timb Date: Tue, 18 Aug 2015 19:01:03 -0700 Subject: try to load pngs from sally into editor properly --- js/clipboard.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'js/clipboard.js') 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': -- cgit v1.2.3-70-g09d2 From f3945e135c17c78a06b613c21c0e02c1438365f9 Mon Sep 17 00:00:00 2001 From: timb Date: Sat, 17 Oct 2015 18:03:52 -0700 Subject: jollo uses non https links for now --- js/clipboard.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/clipboard.js') diff --git a/js/clipboard.js b/js/clipboard.js index 2c32d12..63225d7 100644 --- a/js/clipboard.js +++ b/js/clipboard.js @@ -241,6 +241,7 @@ var clipboard = (function () { } + // http...?a=1&b=2&b=3 -> {a: '1', b: ['2', '3']} function parse_url_search_params(url){ var params = {} url = url.split('?') @@ -296,10 +297,10 @@ var clipboard = (function () { } function sally_url_convert(url){ - var png_regex = /https?:\/\/jollo\.org\/den\/sallies\/([0-9]+)\/([^.]+)\.png/ + 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' + return 'http://jollo.org/den/sallies/' + matches[1] + '/raw-' + matches[2] + '?.txt' // txt suffix to force asdf proxy } -- cgit v1.2.3-70-g09d2 From 878710dd3fd6f1c4d16b92f5b6fd6fab14af6abd Mon Sep 17 00:00:00 2001 From: timb Date: Sat, 17 Oct 2015 20:33:03 -0700 Subject: oops, fix jollo sally regex --- js/clipboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/clipboard.js') diff --git a/js/clipboard.js b/js/clipboard.js index 63225d7..9c3b1b2 100644 --- a/js/clipboard.js +++ b/js/clipboard.js @@ -297,7 +297,7 @@ var clipboard = (function () { } function sally_url_convert(url){ - var png_regex = /$https?:\/\/jollo\.org\/den\/sallies\/([0-9]+)\/([^.]+)\.png^/ + var png_regex = /^https?:\/\/jollo\.org\/den\/sallies\/([0-9]+)\/([^.]+)\.png$/ var matches = url.match(png_regex) if (!matches) return url return 'http://jollo.org/den/sallies/' + matches[1] + '/raw-' + matches[2] + '?.txt' -- cgit v1.2.3-70-g09d2