Display images uploaded in the File app with the Media app

This commit is contained in:
yflory committed 2017-05-04 18:24:58 +02:00
1 parent 28cb40d7ee
commit 706120ae5b
2 files changed
+8 -6

No files matched your search

+1 -1
View File
@@ -1 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MediaTag=t():e.MediaTag=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=81)}([function(e,t,n){"use strict";var r={IMAGE:"image",AUDIO:"audio",VIDEO:"video",PDF:"pdf",DASH:"dash",DOWNLOAD:"download",CRYPTO:"crypto",CLEAR_KEY:"clear-key",MEDIA_OBJECT:"media-object"};e.exports=r},function(e,t,n){"use strict";var r={MATCHER:"matcher",RENDERER:"renderer",FILTER:"filter",SANITIZER:"sanitizer"};e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(1),a=n(4),s=n(6),f=function(e){function t(e,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,c.MATCHER,a.ANY));return i.targetType=n,i}return i(t,e),u(t,[{key:"getTargetType",value:function(){return this.targetType}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),c=n(4),a=n(6),s=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.RENDERER,c.ONCE))}return i(t,e),t}(a);e.exports=s},function(e,t,n){"use strict";var r={EVERY:"every",ANY:"any",ONCE:"once"};e.exports=r},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),c=n(4),a=n(8),s=n(11),f=function(){function e(){o(this,e)}return i(e,null,[{key:"start",value:function(t){var n=e.unstack(t);n?n.type!==u.SANITIZER&&e.fill(t):e.fill(t),e.snapshot(t),e.check(t),e.run(t)}},{key:"snapshot",value:function(t){var n=t.getId();if(e.stacks[n]){var r=[];e.stacks[n].forEach(function(e){var t={};t.identifier=e.getIdentifier(),t.type=e.getType(),r.push(t)}),e.snapshots[n]?e.snapshots[n].push({stack:r}):e.snapshots[n]=[{stack:r}]}else e.snapshots[n]=[]}},{key:"fill",value:function(t){var n=[],o=t.getId(),i=a.getPlugins(u.MATCHER),s=i.filter(function(e){return e.process(t)}),f=s.map(function(e){return e.getIdentifier()}),l=a.values(),p=l.filter(function(e){return e.type!==u.MATCHER&&f.includes(e.identifier)}),y=a.filterByOccurrencies(p),b=!0,h=!1,v=void 0;try{for(var w,g=y.once[Symbol.iterator]();!(b=(w=g.next()).done);b=!0){var d=w.value;n.push(d),y.every&&n.push.apply(n,r(y.every))}}catch(e){h=!0,v=e}finally{try{!b&&g.return&&g.return()}finally{if(h)throw v}}var O=!0,m=!1,k=void 0;try{for(var E,_=y.any[Symbol.iterator]();!(O=(E=_.next()).done);O=!0){var j=E.value;n.push(j),y.every&&n.push.apply(n,r(y.every))}}catch(e){m=!0,k=e}finally{try{!O&&_.return&&_.return()}finally{if(m)throw k}}if(e.stacks[o]){var P=n.shift();if(P){if(P.occurrence!==c.ONCE)throw new Error("The last plugin is not runnable once");var T;(T=e.stacks[o]).push.apply(T,n)}else{var x;(x=e.stacks[o]).push.apply(x,n)}}else e.stacks[o]=n}},{key:"unstack",value:Line truncated
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MediaTag=t():e.MediaTag=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=82)}([function(e,t,n){"use strict";var r={IMAGE:"image",AUDIO:"audio",VIDEO:"video",PDF:"pdf",DASH:"dash",DOWNLOAD:"download",CRYPTO:"crypto",CLEAR_KEY:"clear-key",MEDIA_OBJECT:"media-object"};e.exports=r},function(e,t,n){"use strict";var r={MATCHER:"matcher",RENDERER:"renderer",FILTER:"filter",SANITIZER:"sanitizer"};e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),c=n(5),s=n(6),f=function(e){function t(e,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.MATCHER,c.ANY));return i.targetType=n,i}return i(t,e),u(t,[{key:"getTargetType",value:function(){return this.targetType}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),a=n(5),c=n(6),s=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.RENDERER,a.ONCE))}return i(t,e),t}(c);e.exports=s},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),a=n(5),c=n(8),s=n(12),f=function(){function e(){o(this,e)}return i(e,null,[{key:"start",value:function(t){var n=e.unstack(t);n?n.type!==u.SANITIZER&&e.fill(t):e.fill(t),e.snapshot(t),e.check(t),e.run(t)}},{key:"snapshot",value:function(t){var n=t.getId();if(e.stacks[n]){var r=[];e.stacks[n].forEach(function(e){var t={};t.identifier=e.getIdentifier(),t.type=e.getType(),r.push(t)}),e.snapshots[n]?e.snapshots[n].push({stack:r}):e.snapshots[n]=[{stack:r}]}else e.snapshots[n]=[]}},{key:"fill",value:function(t){var n=[],o=t.getId(),i=c.getPlugins(u.MATCHER),s=i.filter(function(e){return e.process(t)}),f=s.map(function(e){return e.getIdentifier()}),l=c.values(),p=l.filter(function(e){return e.type!==u.MATCHER&&f.includes(e.identifier)}),y=c.filterByOccurrencies(p),b=!0,h=!1,v=void 0;try{for(var w,g=y.once[Symbol.iterator]();!(b=(w=g.next()).done);b=!0){var d=w.value;n.push(d),y.every&&n.push.apply(n,r(y.every))}}catch(e){h=!0,v=e}finally{try{!b&&g.return&&g.return()}finally{if(h)throw v}}var m=!0,O=!1,k=void 0;try{for(var E,_=y.any[Symbol.iterator]();!(m=(E=_.next()).done);m=!0){var j=E.value;n.push(j),y.every&&n.push.apply(n,r(y.every))}}catch(e){O=!0,k=e}finally{try{!m&&_.return&&_.return()}finally{if(O)throw k}}if(e.stacks[o]){var P=n.shift();if(P){if(P.occurrence!==a.ONCE)throw new Error("The last plugin is not runnable once");var A;(A=e.stacks[o]).push.apply(A,n)}else{var T;(T=e.stacks[o]).push.apply(T,n)}}else e.stacks[o]=n}},{key:"unstack",value:function(t){var n=t.getId();return e.stacks[n]?e.stacks[n].pop():null}},{key:"check",vLine truncated
+7 -5
View File
@@ -29,8 +29,6 @@ define([
var fileId = secret.channel;
var hexFileName = Cryptpad.base64ToHex(fileId);
var type = "image/png";
// Test hash:
// #/2/K6xWU-LT9BJHCQcDCT-DcQ/TBo77200c0e-FdldQFcnQx4Y/
var parsed = Cryptpad.parsePadUrl(window.location.href);
var defaultName = Cryptpad.getDefaultName(parsed);
@@ -65,11 +63,16 @@ define([
var $mt = $iframe.find('#encryptedFile');
$mt.attr('src', '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName);
$mt.attr('data-crypto-key', 'salsa20poly1305:'+cryptKey);
$mt.attr('data-crypto-key', 'cryptpad:'+cryptKey);
$mt.attr('data-type', type);
window.onMediaMetadata = function (metadata) {
if (title !== defaultTitle) { return; }
var title = document.title = metadata.name;
updateTitle(title || defaultName);
};
require(['/common/media-tag.js'], function (MediaTag) {
console.log(MediaTag);
var configTb = {
displayed: ['useradmin', 'share', 'newpad'],
ifrw: ifrw,
@@ -85,7 +88,6 @@ define([
}
};
Toolbar.create($bar, null, null, null, null, configTb);
//var $rightside = $bar.find('.' + Toolbar.constants.rightside);
updateTitle(Cryptpad.initialName || getTitle() || defaultName);