From e732284845726071f55e7142505bcfcaf205cec0 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 11 Jul 2017 12:50:16 +0200 Subject: [PATCH] Lint --- www/code/main.js | 2 +- www/slide/main.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/www/code/main.js b/www/code/main.js index 8720be931..1b6cb8997 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -369,7 +369,7 @@ define([ body: $iframe.find('body'), onUploaded: function (ev, data) { //var cursor = editor.getCursor(); - var cleanName = data.name.replace(/[\[\]]/g, ''); + //var cleanName = data.name.replace(/[\[\]]/g, ''); //var text = '!['+cleanName+']('+data.url+')'; var parsed = Cryptpad.parsePadUrl(data.url); var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel); diff --git a/www/slide/main.js b/www/slide/main.js index 4bf4d4440..b3347e501 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -230,11 +230,15 @@ define([ var $span = $('', {'class': 'element'}).appendTo($container); var $inner = $('').text(name); $span.append($inner).click(function () { - var cleanName = name.replace(/[\[\]]/g, ''); - var text = '!['+cleanName+']('+data.href+')'; - editor.replaceSelection(text); + var parsed = Cryptpad.parsePadUrl(data.href); + var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel); + var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName; + var mt = ''; + editor.replaceSelection(mt); + //var cleanName = name.replace(/[\[\]]/g, ''); + //var text = '!['+cleanName+']('+data.href+')'; + //editor.replaceSelection(text); $block.hide(); - console.log(data.href); }); }); }; @@ -622,7 +626,7 @@ define([ body: $iframe.find('body'), onUploaded: function (ev, data) { //var cursor = editor.getCursor(); - var cleanName = data.name.replace(/[\[\]]/g, ''); + //var cleanName = data.name.replace(/[\[\]]/g, ''); //var text = '!['+cleanName+']('+data.url+')'; var parsed = Cryptpad.parsePadUrl(data.url); var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel);