Replace mediatag markdown syntax by html. Enable file upload in /code.
This commit is contained in:
@@ -364,6 +364,21 @@ define([
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UserList.getLastName(toolbar.$userNameButton, isNew);
|
UserList.getLastName(toolbar.$userNameButton, isNew);
|
||||||
|
var fmConfig = {
|
||||||
|
dropArea: $iframe.find('.CodeMirror'),
|
||||||
|
body: $iframe.find('body'),
|
||||||
|
onUploaded: function (ev, data) {
|
||||||
|
//var cursor = editor.getCursor();
|
||||||
|
var cleanName = data.name.replace(/[\[\]]/g, '');
|
||||||
|
//var text = '';
|
||||||
|
var parsed = Cryptpad.parsePadUrl(data.url);
|
||||||
|
var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel);
|
||||||
|
var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName;
|
||||||
|
var mt = '<media-tag src="' + src + '" data-crypto-key="cryptpad:' + parsed.hashData.key + '"></media-tag>';
|
||||||
|
editor.replaceSelection(mt);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
APP.FM = Cryptpad.createFileManager(fmConfig);
|
||||||
};
|
};
|
||||||
|
|
||||||
config.onRemote = function () {
|
config.onRemote = function () {
|
||||||
|
|||||||
@@ -154,9 +154,11 @@ define([
|
|||||||
var $mts = $content.find('media-tag:not(:has(*))');
|
var $mts = $content.find('media-tag:not(:has(*))');
|
||||||
$mts.each(function (i, el) {
|
$mts.each(function (i, el) {
|
||||||
MediaTag(el);
|
MediaTag(el);
|
||||||
|
console.log(el.outerHTML);
|
||||||
var observer = new MutationObserver(function(mutations) {
|
var observer = new MutationObserver(function(mutations) {
|
||||||
mutations.forEach(function(mutation) {
|
mutations.forEach(function(mutation) {
|
||||||
if (mutation.type === 'childList') {
|
if (mutation.type === 'childList') {
|
||||||
|
console.log(el.outerHTML);
|
||||||
var list_values = [].slice.call(el.children);
|
var list_values = [].slice.call(el.children);
|
||||||
mediaMap[el.getAttribute('src')] = list_values;
|
mediaMap[el.getAttribute('src')] = list_values;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -623,11 +623,12 @@ define([
|
|||||||
onUploaded: function (ev, data) {
|
onUploaded: function (ev, data) {
|
||||||
//var cursor = editor.getCursor();
|
//var cursor = editor.getCursor();
|
||||||
var cleanName = data.name.replace(/[\[\]]/g, '');
|
var cleanName = data.name.replace(/[\[\]]/g, '');
|
||||||
var text = '';
|
//var text = '';
|
||||||
/*if (data.mediatag) {
|
var parsed = Cryptpad.parsePadUrl(data.url);
|
||||||
text = '!'+text;
|
var hexFileName = Cryptpad.base64ToHex(parsed.hashData.channel);
|
||||||
}*/
|
var src = '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName;
|
||||||
editor.replaceSelection(text);
|
var mt = '<media-tag src="' + src + '" data-crypto-key="cryptpad:' + parsed.hashData.key + '"></media-tag>';
|
||||||
|
editor.replaceSelection(mt);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
APP.FM = Cryptpad.createFileManager(fmConfig);
|
APP.FM = Cryptpad.createFileManager(fmConfig);
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ div#modal #content, #print {
|
|||||||
|
|
||||||
p {
|
p {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: row wrap;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height:0;
|
min-height:0;
|
||||||
|
|||||||
Reference in New Issue
Block a user