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);