Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 8 years ago
commit 687b4d8307

@ -37,7 +37,9 @@ define([
data.name = file.metadata.name; data.name = file.metadata.name;
data.url = href; data.url = href;
data.mediatag = true; if (file.metadata.type.slice(0,6) === 'image/') {
data.mediatag = true;
}
return data; return data;
}; };

@ -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) { var slice = function (coll) {
return Array.prototype.slice.call(coll); return Array.prototype.slice.call(coll);
@ -127,7 +104,6 @@ define([
return Dom; return Dom;
}; };
//var toTransform = [];
var DD = new DiffDOM({ var DD = new DiffDOM({
preDiffApply: function (info) { preDiffApply: function (info) {
if (unsafeTag(info)) { return true; } if (unsafeTag(info)) { return true; }

@ -531,16 +531,16 @@ define([
}; };
var cursor = editor.coordsChar(obj); var cursor = editor.coordsChar(obj);
*/ */
var cursor = editor.getCursor(); //var cursor = editor.getCursor();
var cleanName = data.name.replace(/[\[\]]/g, ''); var cleanName = data.name.replace(/[\[\]]/g, '');
var text = '['+cleanName+']('+data.url+')'; var text = '['+cleanName+']('+data.url+')';
if (data.mediatag) { if (data.mediatag) {
var text = '!['+cleanName+']('+data.url+')'; text = '!'+text;
} }
editor.replaceSelection(text); editor.replaceSelection(text);
} }
}; };
var FM = Cryptpad.createFileManager(fmConfig); Cryptpad.createFileManager(fmConfig);
}; };
config.onRemote = function () { config.onRemote = function () {

Loading…
Cancel
Save