Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
commit
c3d1554e8c
2 files changed
+8
-5
No files matched your search
@@ -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 i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.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=68)}([function(e,t,n){"use strict";function r(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}}(),o=n(5),u=n(3),a=n(4),c=function(){function e(){r(this,e)}return i(e,null,[{key:"findRequiredModuleIdentifiers",value:function(t){return o.logics().filter(function(n){return n.apply(t)&&!e.forbiddenIdentifiers.includes(n.identifier)}).map(function(e){return e.identifier})}},{key:"findFilterIdentifiersToRegister",value:function(t){return o.logics().filter(function(n){return n.apply(t)&&!e.forbiddenIdentifiers.includes(n.identifier)}).filter(function(e){return"filter"===e.type}).map(function(e){return e.identifier})}},{key:"findPluginIdentifiersToRegister",value:function(t){return o.logics().filter(function(n){return n.apply(t)&&!e.forbiddenIdentifiers.includes(n.identifier)}).filter(function(e){return"plugin"===e.type}).map(function(e){return e.identifier})}},{key:"searchLogicCollision",value:function(e){var t=e.filter(function(e){return a.plugins().find(function(t){return e.identifier===t.identifier})});return t.length>1?{modules:t}:null}},{key:"findModuleChain",value:function(t){var n=e.findRequiredModuleIdentifiers(t),r=n.map(function(e){var t=u.getFilter(e)||a.getPlugin(e);if(t)return t;throw new Error("Module "+e+" not found")}),i=e.searchLogicCollision(r);if(i){var o=i.modules.map(function(e){return e.identifier});throw new Error("Has collision between ["+o+"]'s logics")}return r}},{key:"startup",value:function(t){if(o.hasLogics()===!1)return void console.warn("Guidelines havn't logics ... The orchestrator cannot do anything !");var n=t.getId();e.chains[n]=e.findModuleChain(t),e.history[n]={identifiers:[e.findRequiredModuleIdentifiers(t)],cycles:{}},e.chains[n].length>0&&e.run(t)}},{key:"coherence",value:function(t){var n=t.getId(),r=e.history[n].identifiers.length-1;if(Object.keys(e.history[n].cycles).some(function(t){return e.history[n].cycles[t]>e.allowedCycles}))throw console.log(e.history[n]),new Error("Maximum cycles exceed "+e.history[n].cycles);var i=e.history[n].identifiers[r-1].every(function(t){return e.history[n].identifiers[r].includes(t)})||e.history[n].identifiers[r-1][0]===e.history[n].identifiers[r][0],o=e.history[n].identifiers[r][0];i&&(console.info('Chain has not evolved since the last module execution, the module "%s" is skipped',o),e.chains[n].shift())}},{key:"run",value:function(t){var n=t.getId();e.chains[n][0]?e.chains[n][0].startup(t):console.warn("Attempts to run a empty chain ...","History : ",e.history[n])}},{key:"chain",value:function(t){e.update(t),e.coherence(t),e.run(t)}},{key:"update",value:function(t){var n=t.getId(),r=e.chains[n].shift();e.findModuleChain(t).filter(function(t){return!e.chains[n].includes(t)}).forEach(function(t){e.chains[n].unshift(t)});var i=e.history[n].cycles[r.identifier];e.history[n].cycles[r.identifier]="number"==typeof i?i+1:1;var o=e.chains[n].map(function(e){return e.identifier});e.history[n].identifiers.push(o)}}]),e}();c.chains={},c.history={},c.allowedCycles=1,c.forbiddenIdentifiers=[],e.exports=c},,,function(e,t,n){"use strict";function r(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}}(),o=function(){function e(){r(this,e)}return i(e,null,[{key:"identifiers",value:function(){return Object.keys(e.filtersMap)}},{key:"filters",value:function(){return Object.keys(e.filtersMap).map(function(t){return e.filtersMap[t]})}},{key:"isRegistered",value:function(t){return t.identifier in e.filtersMap}},{key:"register",value:function(t){t&&(e.isRegistered(t)&&console.warn('Filter "'+t.identifier+'" is already registered and will be overwritten'),e.filtersMap[t.identifier]=t)}},{key:"getFilter",value:function(t){return e.filters().find(function(e){return e.identifier===t})}},{key:"findType",value:function(t){vaLine 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
-4
@@ -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,9 +63,15 @@ define([
|
||||
|
||||
var $mt = $iframe.find('#encryptedFile');
|
||||
$mt.attr('src', '/blob/' + hexFileName.slice(0,2) + '/' + hexFileName);
|
||||
$mt.attr('data-crypto-key', 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) {
|
||||
var configTb = {
|
||||
displayed: ['useradmin', 'share', 'newpad'],
|
||||
@@ -84,7 +88,6 @@ define([
|
||||
}
|
||||
};
|
||||
Toolbar.create($bar, null, null, null, null, configTb);
|
||||
//var $rightside = $bar.find('.' + Toolbar.constants.rightside);
|
||||
|
||||
updateTitle(Cryptpad.initialName || getTitle() || defaultName);
|
||||
|
||||
|
||||
Reference in new issue
Block a user