diff --git a/www/common/common-file.js b/www/common/common-file.js index 843196f83..b6c59e581 100644 --- a/www/common/common-file.js +++ b/www/common/common-file.js @@ -37,7 +37,9 @@ define([ data.name = file.metadata.name; data.url = href; - data.mediatag = true; + if (file.metadata.type.slice(0,6) === 'image/') { + data.mediatag = true; + } return data; }; diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 1394fe7da..4adbbc18f 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -82,29 +82,6 @@ define([ } }; - var getSubMediaTag = function (element) { - var result = []; - console.log(element); - if (element.nodeName === "MEDIA-TAG") { - result.push(element); - return result; - } - if (element.childNodes) { - element.childNodes.forEach(function (el) { - result = result.concat(getSubMediaTag(el, result)); - }); - } - console.log(result); - return result; - }; - var mediaTag = function (info) { - if (info.diff.action === 'addElement') { - return getSubMediaTag(info.diff.element); - //MediaTag.CryptoFilter.setAllowedMediaTypes(allowedMediaTypes); - //MediaTag($mt[0]); - } - return; - }; var slice = function (coll) { return Array.prototype.slice.call(coll); @@ -127,7 +104,6 @@ define([ return Dom; }; - //var toTransform = []; var DD = new DiffDOM({ preDiffApply: function (info) { if (unsafeTag(info)) { return true; } diff --git a/www/slide/main.js b/www/slide/main.js index d0299ff6d..f1870eead 100644 --- a/www/slide/main.js +++ b/www/slide/main.js @@ -531,16 +531,16 @@ define([ }; var cursor = editor.coordsChar(obj); */ - var cursor = editor.getCursor(); + //var cursor = editor.getCursor(); var cleanName = data.name.replace(/[\[\]]/g, ''); var text = '['+cleanName+']('+data.url+')'; if (data.mediatag) { - var text = '!['+cleanName+']('+data.url+')'; + text = '!'+text; } editor.replaceSelection(text); } }; - var FM = Cryptpad.createFileManager(fmConfig); + Cryptpad.createFileManager(fmConfig); }; config.onRemote = function () {