fix nacl reference error in media tag
This commit is contained in:
parent
cb7efeebe1
commit
9f6ecea5d9
@ -9,7 +9,6 @@ define([
|
||||
'/common/cryptpad-common.js',
|
||||
'/common/cryptget.js',
|
||||
'/common/diffMarked.js',
|
||||
'/bower_components/tweetnacl/nacl-fast.min.js', // needed for media-tag
|
||||
|
||||
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
||||
'less!/customize/src/less/cryptpad.less'
|
||||
|
||||
@ -16,9 +16,10 @@ define([
|
||||
|
||||
'/common/clipboard.js',
|
||||
'/common/pinpad.js',
|
||||
'/customize/application_config.js'
|
||||
'/customize/application_config.js',
|
||||
'/common/media-tag.js',
|
||||
], function ($, Config, Messages, Store, Util, Hash, UI, History, UserList, Title, Metadata,
|
||||
CodeMirror, Files, FileCrypto, Clipboard, Pinpad, AppConfig) {
|
||||
CodeMirror, Files, FileCrypto, Clipboard, Pinpad, AppConfig, MediaTag) {
|
||||
|
||||
/* This file exposes functionality which is specific to Cryptpad, but not to
|
||||
any particular pad type. This includes functions for committing metadata
|
||||
@ -1278,12 +1279,10 @@ define([
|
||||
var $img = $('<media-tag>').appendTo($container);
|
||||
$img.attr('src', src);
|
||||
$img.attr('data-crypto-key', 'cryptpad:' + cryptKey);
|
||||
require(['/common/media-tag.js'], function (MediaTag) {
|
||||
MediaTag($img[0]);
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type === 'childList' && mutation.addedNodes.length) {
|
||||
console.log(mutation);
|
||||
if (mutation.addedNodes.length > 1 ||
|
||||
mutation.addedNodes[0].nodeName !== 'IMG') {
|
||||
$img.remove();
|
||||
@ -1307,7 +1306,6 @@ define([
|
||||
$image.on('load', onLoad);
|
||||
}
|
||||
});
|
||||
});
|
||||
observer.observe($img[0], {
|
||||
attributes: false,
|
||||
childList: true,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -7,12 +7,14 @@ define([
|
||||
'/common/visible.js',
|
||||
'/common/notify.js',
|
||||
'/file/file-crypto.js',
|
||||
|
||||
'/common/media-tag.js',
|
||||
|
||||
'/bower_components/file-saver/FileSaver.min.js',
|
||||
'/bower_components/tweetnacl/nacl-fast.min.js',
|
||||
|
||||
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
||||
'less!/customize/src/less/cryptpad.less',
|
||||
], function ($, Crypto, realtimeInput, Toolbar, Cryptpad, Visible, Notify, FileCrypto) {
|
||||
], function ($, Crypto, realtimeInput, Toolbar, Cryptpad, Visible, Notify, FileCrypto, MediaTag) {
|
||||
var Messages = Cryptpad.Messages;
|
||||
var saveAs = window.saveAs;
|
||||
var Nacl = window.nacl;
|
||||
@ -133,7 +135,6 @@ define([
|
||||
console.log(progress.percent);
|
||||
});
|
||||
|
||||
require(['/common/media-tag.js'], function (MediaTag) {
|
||||
/**
|
||||
* Allowed mime types that have to be set for a rendering after a decryption.
|
||||
*
|
||||
@ -158,7 +159,6 @@ define([
|
||||
MediaTag.CryptoFilter.setAllowedMediaTypes(allowedMediaTypes);
|
||||
|
||||
MediaTag($mt[0]);
|
||||
});
|
||||
};
|
||||
|
||||
var todoBigFile = function (sizeMb) {
|
||||
|
||||
@ -11,7 +11,6 @@ define([
|
||||
'/bower_components/marked/marked.min.js',
|
||||
'cm/lib/codemirror',
|
||||
'cm/mode/markdown/markdown',
|
||||
'/bower_components/tweetnacl/nacl-fast.min.js',
|
||||
'less!/profile/main.less',
|
||||
], function ($, Cryptpad, Listmap, Crypto, Marked, CodeMirror) {
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ define([
|
||||
'/common/cryptpad-common.js',
|
||||
'/common/cryptget.js',
|
||||
'/slide/slide.js',
|
||||
'/bower_components/tweetnacl/nacl-fast.min.js', // needed for media-tag
|
||||
|
||||
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
||||
'less!/customize/src/less/cryptpad.less',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user