diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 55945ccd2..5fac0939b 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -570,15 +570,12 @@ define([ }; var appToolbar = function () { - return h('div#toolbar.cryptpad-toolbar'); - }; - var appToolbar3 = function () { return h('div#cp-toolbar.cp-toolbar-container'); }; Pages['/whiteboard/'] = Pages['/whiteboard/index.html'] = function () { return [ - appToolbar3(), + appToolbar(), h('div#cp-app-whiteboard-canvas-area', h('canvas#cp-app-whiteboard-canvas', { width: 600, height: 600 @@ -639,47 +636,49 @@ define([ Pages['/poll/'] = Pages['/poll/index.html'] = function () { return [ appToolbar(), - h('div#content', [ - h('div#poll', [ - h('div#howItWorks', [ + h('div#cp-app-poll-content', [ + h('div#cp-app-poll-form', [ + h('div#cp-app-poll-help', [ h('h1', 'CryptPoll'), setHTML(h('h2'), Msg.poll_subtitle), h('p', Msg.poll_p_save), h('p', Msg.poll_p_encryption) ]), - h('div.upper', [ - h('button#publish.btn.btn-success', { - style: { display: 'none' } - }, Msg.poll_publish_button), - h('button#admin.btn.btn-primary', { - style: { display: 'none' }, - title: Msg.poll_admin_button - }, Msg.poll_admin_button), - h('button#help.btn.btn-secondary', { - title: Msg.poll_show_help_button - }, Msg.poll_show_help_button) - ]), - h('div.realtime', [ + h('div.cp-app-poll-realtime', [ h('br'), - h('center', [ - h('textarea#description', { + h('div', [ + h('textarea#cp-app-poll-description', { rows: "5", cols: "50", + placeholder: Msg.poll_descriptionHint, disabled: true }), + h('div#cp-app-poll-description-published'), h('br') ]), - h('div#tableContainer', [ - h('div#tableScroll'), - h('button#create-user.btn.btn-secondary', { + h('div#cp-app-poll-table-container', [ + h('div#cp-app-poll-table-scroll'), + h('button#cp-app-poll-create-user.btn.btn-secondary', { title: Msg.poll_create_user }, h('span.fa.fa-plus')), - h('button#create-option.btn.btn-secondary', { + h('button#cp-app-poll-create-option.btn.btn-secondary', { title: Msg.poll_create_option }, h('span.fa.fa-plus')), - h('button#commit.btn.btn-secondary', { - title: Msg.poll_commit - }, h('span.fa.fa-check')) + ]), + h('div#cp-app-poll-comments', [ + h('h2#cp-app-poll-comments-add-title', Msg.poll_comment_add), + h('div#cp-app-poll-comments-add', [ + h('input.cp-app-poll-comments-add-name', { + type: 'text' + }), + h('textarea.cp-app-poll-comments-add-msg'), + h('button.cp-app-poll-comments-add-submit.btn.btn-secondary', + Msg.poll_comment_submit), + h('button.cp-app-poll-comments-add-cancel.btn.btn-secondary', + Msg.cancel) + ]), + h('h2#cp-app-poll-comments-list-title', Msg.poll_comment_list), + h('div#cp-app-poll-comments-list') ]) ]) ]) diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index a81b13e82..85a906902 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -31,6 +31,6 @@ body.cp-app-slide { @import "../../../slide/app-slide.less"; } body.cp-app-file { @import "../../../file/app-file.less"; } body.cp-app-filepicker { @import "../../../filepicker/app-filepicker.less"; } body.cp-app-contacts { @import "../../../contacts/app-contacts.less"; } -//body.cp-app-poll { @import "../../../poll/app-poll.less"; } +body.cp-app-poll { @import "../../../poll/app-poll.less"; } body.cp-app-whiteboard { @import "../../../whiteboard/app-whiteboard.less"; } diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index c930a8997..49cf9fdb1 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -245,7 +245,9 @@ define(function () { out.poll_removeUser = "Êtes-vous sûr de vouloir supprimer cet utilisateur ?"; out.poll_titleHint = "Titre"; - out.poll_descriptionHint = "Description"; + out.poll_descriptionHint = "Décrivez votre sondage puis cliquer sur le bouton ✓ (Publier).\n" + + "La description peut contenir de la syntaxe markdown, et vous pouvez y ajouter des images stockées dans votre CryptDrive.\n" + + "Toutes les personnes possédant le lien d'édition de ce sondage peuvent modifier la description, bien que ce soit déconseillé."; out.poll_remove = "Supprimer"; out.poll_edit = "Modifier"; @@ -255,6 +257,15 @@ define(function () { out.poll_show_help_button = "Afficher l'aide"; out.poll_hide_help_button = "Cacher l'aide"; + out.poll_bookmark_col = "Marquer cette colonne comme favorite pour qu'elle soit toujours déverouillée et affichée en première position."; + out.poll_bookmarked_col = "Voici votre colonne favorite; elle sera toujours dévérouillée et affichée en première position."; + out.poll_total = 'TOTAL'; + + out.poll_comment_list = "Commentaires"; + out.poll_comment_add = "Ajouter un commentaire"; + out.poll_comment_submit = "Envoyer"; + out.poll_comment_remove = "Supprimer ce commentaire"; + // Canvas out.canvas_clear = "Nettoyer"; out.canvas_delete = "Supprimer la sélection"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 524ceb3e3..a5afb6ec7 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -250,7 +250,9 @@ define(function () { out.poll_removeUser = "Are you sure you'd like to remove this user?"; out.poll_titleHint = "Title"; - out.poll_descriptionHint = "Describe your poll, and use the 'publish' button when you're done. Anyone with the link can change the description, but this is discouraged."; + out.poll_descriptionHint = "Describe your poll, and use the ✓ (publish) button when you're done.\n" + + "The description can be written using markdown syntax and you can embed media elements from your CryptDrive.\n" + + "Anyone with the link can change the description, but this is discouraged."; out.poll_remove = "Remove"; out.poll_edit = "Edit"; @@ -260,6 +262,15 @@ define(function () { out.poll_show_help_button = "Show help"; out.poll_hide_help_button = "Hide help"; + out.poll_bookmark_col = 'Bookmark this column so that it is always unlocked and displayed at the beginning for you'; + out.poll_bookmarked_col = 'This is your bookmarked column. It will always be unlocked and displayed at the beginning for you.'; + out.poll_total = 'TOTAL'; + + out.poll_comment_list = "Comments"; + out.poll_comment_add = "Add a comment"; + out.poll_comment_submit = "Send"; + out.poll_comment_remove = "Delete this comment"; + // Canvas out.canvas_clear = "Clear"; out.canvas_delete = "Delete selection"; @@ -385,6 +396,7 @@ define(function () { out.fc_remove = "Delete permanently"; out.fc_empty = "Empty the trash"; out.fc_prop = "Properties"; + out.fc_hashtag = "Tags"; out.fc_sizeInKilobytes = "Size in Kilobytes"; // fileObject.js (logs) out.fo_moveUnsortedError = "You can't move a folder to the list of unsorted pads"; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index fee97a837..badfa4e57 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -191,6 +191,8 @@ define([ var listener; var close = Util.once(function (result, ev) { + ev.stopPropagation(); + ev.preventDefault(); var $frame = $(tagger).fadeOut(150, function () { stopListening(listener); $frame.remove(); @@ -198,17 +200,21 @@ define([ }); }); - var $ok = findOKButton(tagger).click(function () { + var $ok = findOKButton(tagger).click(function (e) { var tokens = field.getTokens(); - close(tokens); + close(tokens, e); }); - var $cancel = findCancelButton(tagger).click(function () { - close(null); + var $cancel = findCancelButton(tagger).click(function (e) { + close(null, e); }); listenForKeys(function () { $ok.click(); }, function () { $cancel.click(); + }, tagger); + + $(tagger).on('click submit', function (e) { + e.stopPropagation(); }); document.body.appendChild(tagger); @@ -503,7 +509,7 @@ define([ var $icon = $defaultIcon.clone(); if (AppConfig.applicationsIcon && AppConfig.applicationsIcon[type]) { - var appClass = ' cp-icon-color-'+type; + var appClass = ' cp-icon cp-icon-color-'+type; $icon = $('', {'class': 'fa ' + AppConfig.applicationsIcon[type] + appClass}); } diff --git a/www/common/media-tag.js b/www/common/media-tag.js index d49ec0557..acdee91da 100644 --- a/www/common/media-tag.js +++ b/www/common/media-tag.js @@ -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.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=63)}([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){if(e instanceof Array){var t=[];return e.forEach(function(e){if(e.mediaObject)t.push(e.mediaObject);else{new c(e,r.processingEngine).mediaObjects.forEach(function(e){t.push(r.processingEngine.start(e))})}}),t}new c(e,r.processingEngine).mediaObjects.forEach(function(e){r.processingEngine.start(e)})}var o=n(31),i=n(33),u=n(34),a=n(35),c=n(36);r.pluginStore=r.pluginStore||new u,r.uriStore=r.uriStore||new a("../plugins"),r.processingEngine=r.processingEngine||new o(r.pluginStore),r.matchingEngine=r.matchingEngine||new i(r.pluginStore,r.uriStore),r.loadingEngine=null,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=0&&f.mediaTypes.splice(t,1)},f.removeAllAllowedMediaTypes=function(e){e.forEach(function(e){f.removeAllowedMediaType(e)})},f.isAllowedMediaType=function(e){return f.mediaTypes.some(function(t){return t===e})},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")}var o=function(){function e(e,t){for(var n=0;n0}}]),e}();e.exports=i},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={PluginExists:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Plugin with same "'+e.identifier+'" identifier found.'))}return i(t,e),t}(Error),TypeNotFound:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Media Tag could not find the content type of an instance.}."))}return i(t,e),t}(Error),FilterExists:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Filter with same "'+e.identifier+' identifier found."'))}return i(t,e),t}(Error),FetchFail:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Could not fetch "'+e.url+'", received "'+e.status+": "+e.statusText+'".'))}return i(t,e),t}(Error),InvalidCryptoKey:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Invalid cryptographic key."))}return i(t,e),t}(Error),InvalidCryptoLib:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Invalid cryptographic algorithm name."))}return i(t,e),t}(Error),FailedCrypto:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Failed to decrypt file"+(e&&e.message?" "+e.message:"")+"."))}return i(t,e),t}(Error)};e.exports=u},function(e,t,n){"use strict";var r=n(21),o=n(43),i=n(44),u=n(45),a=n(46),c=n(47),s=n(48),f=n(7),l=n(49),p=n(50);r.pluginStore.store(new o),r.pluginStore.store(new i),r.pluginStore.store(new u),r.pluginStore.store(new a),r.pluginStore.store(new c),r.pluginStore.store(new s),r.pluginStore.store(new f),r.pluginStore.store(new l),r.pluginStore.store(new p);var y=n(51),h=n(52);f.functionStore.store("salsa20poly1305",y),f.functionStore.store("cryptpad",h);var b=new s("

MediaTag cannot find a plugin able to renderer your content

","Download");r.processingEngine.setDefaultPlugin(b),r.CryptoFilter=f;var d=["image/png","image/jpeg","image/jpg","image/gif","audio/mp3","audio/ogg","audio/wav","audio/webm","video/mp4","video/ogg","video/webm","application/pdf","application/dash+xml","download"];r.CryptoFilter.setAllowedMediaTypes(d);var v=n(53),g=(n(14),n(0),new v);r.PdfPlugin=a,r.PdfPlugin.viewer="/pdfjs/web/viewer.html",r.processingEngine.configure(g),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=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.SANITIZER,a.EVERY))}return i(t,e),t}(c);e.exports=s},function(e,t,n){"use strict";var r=n(22),o=n(23),i=n(24),u=n(25),a=n(26),c=n(27),s=n(28),f=n(29),l=n(30),p=n(2);p.pluginStore.store(new r),p.pluginStore.store(new o),p.pluginStore.store(new i),p.pluginStore.store(new u),p.pluginStore.store(new a),p.pluginStore.store(new c),p.pluginStore.store(new s),p.pluginStore.store(new f),p.pluginStore.store(new l),e.exports=p},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=e.STACK_LIMIT)throw console.error(this.snapshots[n]),new Error("Plugin stack size exceed");if(this.snapshots[n].length>=e.SNAPSHOT_LIMIT)throw console.error(this.snapshots[n]),new Error("Plugin snapshots size exceed");var r=0;if(this.stacks[n].forEach(function(e){e.type===a.RENDERER&&r++}),r>1)throw console.error(this.snapshots[n]),new Error("More of one renderer in the stack");if(0===this.stacks[n].length&&!this.stats[n][a.RENDERER]){if(!this.defaultPlugin)throw new Error("No default plugin assignated");this.stacks[n].unshift(this.defaultPlugin)}}},{key:"return",value:function(e){var t=e.getId(),n=this.unstack(e);if(n){try{this.stats[t]||(this.stats[t]={}),this.stats[t][n.type]?this.stats[t][n.type]+=1:this.stats[t][n.type]=1}catch(e){console.error(e,this.snapshots[t])}0===this.stacks[t].length&&n.type===a.RENDERER?this.run(e):n.type!==a.SANITIZER&&this.fill(e),this.snapshot(e),this.check(e),this.run(e)}}},{key:"process",value:function(e){var t=e.getId(),n=this.stacks[t].length,r=this.stacks[t][n-1];if(!r)throw console.log(this.stacks),new Error("Impossible to run a undefined plugin");r.process(e)}},{key:"isStacked",value:function(e,t){var n=e.getId();return!(!this.stacks[n]||!this.stacks[n].includes(t))}},{key:"setDefaultPlugin",value:function(e){this.defaultPlugin=e}}]),e}();f.STACK_LIMIT=100,f.SNAPSHOT_LIMIT=100,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")}var o=function(){function e(e,t){for(var n=0;n0&&r(e.mediaObjects[t-1],e)}},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 o=function(){function e(e,t){for(var n=0;n1?t[0]:window.location.protocol}},{key:"hostname",value:function(e){var t=e.getAttribute("src").split("://");return t.length>1?t[1].split("/")[0]:window.location.hostname}},{key:"source",value:function(e){return e.getAttribute("src")}},{key:"schemes",value:function(e){return/\w+:/.exec(e.getAttribute("src"))}},{key:"sources",value:function(e){var t=e.getAttribute("sources")||e.getAttribute("srcs");return t?JSON.parse(t):null}},{key:"actions",value:function(e){var t=e.getAttribute("actions");return t?JSON.parse(t):null}},{key:"parse",value:function(t){return{protocol:e.protocol(t),hostname:e.hostname(t),src:e.source(t),type:e.type(t),extension:e.extension(t),mime:e.mime(t),sources:e.sources(t),actions:e.actions(t)}}}]),e}();e.exports=i},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;n1;){if("number"!=typeof e[t])throw new Error("E_UNSAFE_TYPE");if(e[t]>255)throw new Error("E_OUT_OF_BOUNDS");if(255!==e[t])return void e[t]++;if(e[t]=0,0===t)throw new Error("E_NONCE_TOO_LARGE")}}},{key:"encodePrefix",value:function(e){return[65280,255].map(function(t,n){return(e&t)>>8*(1-n)})}},{key:"decodePrefix",value:function(e){return e[0]<<8|e[1]}},{key:"joinChunks",value:function(e){return new Blob(e)}},{key:"slice",value:function(e){return Array.prototype.slice.call(e)}},{key:"getRandomKeyStr",value:function(){var e=window.nacl,t=e.randomBytes(18);return e.util.encodeBase64(t)}},{key:"getKeyFromStr",value:function(e){return window.nacl.util.decodeBase64(e)}},{key:"encrypt",value:function(){}},{key:"decrypt",value:function(t,n,r){var o=window.nacl,i=function(e){var n=new Event("decryptionProgress");n.percent=e/t.length*100,console.log(n.percent),window.document.dispatchEvent(n)},u=e.createNonce(),a=0,c=t.subarray(0,2),s=e.decodePrefix(c),f={metadata:void 0},l=new Uint8Array(t.subarray(2,2+s)),p=o.secretbox.open(l,u,n);e.increment(u);try{f.metadata=JSON.parse(o.util.encodeUTF8(p))}catch(e){return r("E_METADATA_DECRYPTION")}if(!f.metadata)return r("NO_METADATA");var y=function(r){setTimeout(function(){var c=131088*a+2+s,f=c+131088;a++;var l=new Uint8Array(t.subarray(c,f)),p=o.secretbox.open(l,u,n);if(e.increment(u),!p)return void r("DECRYPTION_FAILURE");i(Math.min(f,t.length)),r(void 0,p)})},h=[];!function n(){y(function(o,i){return o?setTimeout(function(){r(o)}):i?2+s+131088*a<=t.length?(h.push(i),n()):(h.push(i),f.content=e.joinChunks(h),r(void 0,f)):void r("UNEXPECTED_ENDING")})}()}}]),e}(),l=function(){function e(){r(this,e)}return u(e,null,[{key:"getArrayBuffer",value:function(e){return fetch(e).then(function(e){if(e.ok)return e.arrayBuffer();throw new a.FetchFails}).then(function(e){return e})}},{key:"createUrl",value:function(e){return window.URL.createObjectURL(e)}},{key:"getBlobUrl",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t}))}},{key:"getDataUrl",value:function(e,t){return"data:"+t+";base64,"+window.nacl.util.encodeBase64(e)}}]),e}();e.exports=i},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 o=function(){function e(e,t){for(var n=0;n=0&&f.mediaTypes.splice(t,1)},f.removeAllAllowedMediaTypes=function(e){e.forEach(function(e){f.removeAllowedMediaType(e)})},f.isAllowedMediaType=function(e){return f.mediaTypes.some(function(t){return t===e})},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")}var o=function(){function e(e,t){for(var n=0;n0}}]),e}();e.exports=i},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={PluginExists:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Plugin with same "'+e.identifier+'" identifier found.'))}return i(t,e),t}(Error),TypeNotFound:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Media Tag could not find the content type of an instance.}."))}return i(t,e),t}(Error),FilterExists:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Filter with same "'+e.identifier+' identifier found."'))}return i(t,e),t}(Error),FetchFail:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Could not fetch "'+e.url+'", received "'+e.status+": "+e.statusText+'".'))}return i(t,e),t}(Error),InvalidCryptoKey:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Invalid cryptographic key."))}return i(t,e),t}(Error),InvalidCryptoLib:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Invalid cryptographic algorithm name."))}return i(t,e),t}(Error),FailedCrypto:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Failed to decrypt file"+(e&&e.message?" "+e.message:"")+"."))}return i(t,e),t}(Error)};e.exports=u},function(e,t,n){"use strict";var r=n(21),o=n(43),i=n(44),u=n(45),a=n(46),c=n(47),s=n(48),f=n(7),l=n(49),p=n(50);r.pluginStore.store(new o),r.pluginStore.store(new i),r.pluginStore.store(new u),r.pluginStore.store(new a),r.pluginStore.store(new c),r.pluginStore.store(new s),r.pluginStore.store(new f),r.pluginStore.store(new l),r.pluginStore.store(new p);var y=n(51),h=n(52);f.functionStore.store("salsa20poly1305",y),f.functionStore.store("cryptpad",h);var b=new s("

MediaTag cannot find a plugin able to renderer your content

","Download");r.processingEngine.setDefaultPlugin(b),r.CryptoFilter=f;var d=["image/png","image/jpeg","image/jpg","image/gif","audio/mp3","audio/ogg","audio/wav","audio/webm","video/mp4","video/ogg","video/webm","application/pdf","application/dash+xml","download"];r.CryptoFilter.setAllowedMediaTypes(d);var v=n(53),g=(n(14),n(0),new v);r.PdfPlugin=a,r.PdfPlugin.viewer="/pdfjs/web/viewer.html",r.processingEngine.configure(g),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=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.SANITIZER,a.EVERY))}return i(t,e),t}(c);e.exports=s},function(e,t,n){"use strict";var r=n(22),o=n(23),i=n(24),u=n(25),a=n(26),c=n(27),s=n(28),f=n(29),l=n(30),p=n(2);p.pluginStore.store(new r),p.pluginStore.store(new o),p.pluginStore.store(new i),p.pluginStore.store(new u),p.pluginStore.store(new a),p.pluginStore.store(new c),p.pluginStore.store(new s),p.pluginStore.store(new f),p.pluginStore.store(new l),e.exports=p},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=e.STACK_LIMIT)throw console.error(this.snapshots[n]),new Error("Plugin stack size exceed");if(this.snapshots[n].length>=e.SNAPSHOT_LIMIT)throw console.error(this.snapshots[n]),new Error("Plugin snapshots size exceed");var r=0;if(this.stacks[n].forEach(function(e){e.type===a.RENDERER&&r++}),r>1)throw console.error(this.snapshots[n]),new Error("More of one renderer in the stack");if(0===this.stacks[n].length&&!this.stats[n][a.RENDERER]){if(!this.defaultPlugin)throw new Error("No default plugin assignated");this.stacks[n].unshift(this.defaultPlugin)}}},{key:"return",value:function(e){var t=e.getId(),n=this.unstack(e);if(n){try{this.stats[t]||(this.stats[t]={}),this.stats[t][n.type]?this.stats[t][n.type]+=1:this.stats[t][n.type]=1}catch(e){console.error(e,this.snapshots[t])}0===this.stacks[t].length&&n.type===a.RENDERER?this.run(e):n.type!==a.SANITIZER&&this.fill(e),this.snapshot(e),this.check(e),this.run(e)}}},{key:"process",value:function(e){var t=e.getId(),n=this.stacks[t].length,r=this.stacks[t][n-1];if(!r)throw console.log(this.stacks),new Error("Impossible to run a undefined plugin");r.process(e)}},{key:"isStacked",value:function(e,t){var n=e.getId();return!(!this.stacks[n]||!this.stacks[n].includes(t))}},{key:"setDefaultPlugin",value:function(e){this.defaultPlugin=e}}]),e}();f.STACK_LIMIT=100,f.SNAPSHOT_LIMIT=100,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")}var o=function(){function e(e,t){for(var n=0;n0&&r(e.mediaObjects[t-1],e)}},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 o=function(){function e(e,t){for(var n=0;n1?t[0]:window.location.protocol}},{key:"hostname",value:function(e){var t=e.getAttribute("src").split("://");return t.length>1?t[1].split("/")[0]:window.location.hostname}},{key:"source",value:function(e){return e.getAttribute("src")}},{key:"schemes",value:function(e){return/\w+:/.exec(e.getAttribute("src"))}},{key:"sources",value:function(e){var t=e.getAttribute("sources")||e.getAttribute("srcs");return t?JSON.parse(t):null}},{key:"actions",value:function(e){var t=e.getAttribute("actions");return t?JSON.parse(t):null}},{key:"parse",value:function(t){return{protocol:e.protocol(t),hostname:e.hostname(t),src:e.source(t),type:e.type(t),extension:e.extension(t),mime:e.mime(t),sources:e.sources(t),actions:e.actions(t)}}}]),e}();e.exports=i},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;n1;){if("number"!=typeof e[t])throw new Error("E_UNSAFE_TYPE");if(e[t]>255)throw new Error("E_OUT_OF_BOUNDS");if(255!==e[t])return void e[t]++;if(e[t]=0,0===t)throw new Error("E_NONCE_TOO_LARGE")}}},{key:"encodePrefix",value:function(e){return[65280,255].map(function(t,n){return(e&t)>>8*(1-n)})}},{key:"decodePrefix",value:function(e){return e[0]<<8|e[1]}},{key:"joinChunks",value:function(e){return new Blob(e)}},{key:"slice",value:function(e){return Array.prototype.slice.call(e)}},{key:"getRandomKeyStr",value:function(){var e=window.nacl,t=e.randomBytes(18);return e.util.encodeBase64(t)}},{key:"getKeyFromStr",value:function(e){return window.nacl.util.decodeBase64(e)}},{key:"encrypt",value:function(){}},{key:"decrypt",value:function(t,n,r){var o=window.nacl,i=function(e){var n=new Event("decryptionProgress");n.percent=e/t.length*100,window.document.dispatchEvent(n)},u=e.createNonce(),a=0,c=t.subarray(0,2),s=e.decodePrefix(c),f={metadata:void 0},l=new Uint8Array(t.subarray(2,2+s)),p=o.secretbox.open(l,u,n);e.increment(u);try{f.metadata=JSON.parse(o.util.encodeUTF8(p))}catch(e){return r("E_METADATA_DECRYPTION")}if(!f.metadata)return r("NO_METADATA");var y=function(r){setTimeout(function(){var c=131088*a+2+s,f=c+131088;a++;var l=new Uint8Array(t.subarray(c,f)),p=o.secretbox.open(l,u,n);if(e.increment(u),!p)return void r("DECRYPTION_FAILURE");i(Math.min(f,t.length)),r(void 0,p)})},h=[];!function n(){y(function(o,i){return o?setTimeout(function(){r(o)}):i?2+s+131088*a<=t.length?(h.push(i),n()):(h.push(i),f.content=e.joinChunks(h),r(void 0,f)):void r("UNEXPECTED_ENDING")})}()}}]),e}(),l=function(){function e(){r(this,e)}return u(e,null,[{key:"getArrayBuffer",value:function(e){return fetch(e).then(function(e){if(e.ok)return e.arrayBuffer();throw new a.FetchFails}).then(function(e){return e})}},{key:"createUrl",value:function(e){return window.URL.createObjectURL(e)}},{key:"getBlobUrl",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t}))}},{key:"getDataUrl",value:function(e,t){return"data:"+t+";base64,"+window.nacl.util.encodeBase64(e)}}]),e}();e.exports=i},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 o=function(){function e(e,t){for(var n=0;n', { diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 322a1c73a..6913f7ef5 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -65,6 +65,7 @@ define([ Cryptpad.ready(waitFor()); })); }).nThen(function (waitFor) { + $('#sbox-iframe').focus(); sframeChan.on('EV_CACHE_PUT', function (x) { Object.keys(x).forEach(function (k) { @@ -401,7 +402,7 @@ define([ }); sframeChan.on('Q_TAGS_GET', function (data, cb) { - Cryptpad.getPadTags(null, function (err, data) { + Cryptpad.getPadTags(data, function (err, data) { cb({ error: err, data: data @@ -410,8 +411,7 @@ define([ }); sframeChan.on('EV_TAGS_SET', function (data) { - console.log(data); - Cryptpad.resetTags(null, data); + Cryptpad.resetTags(data.href, data.tags); }); sframeChan.on('Q_PIN_GET_USAGE', function (data, cb) { diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index d1d0b43fa..b0f5a654e 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -21,6 +21,7 @@ define([ var $title; exp.setToolbar = function (toolbar) { $title = toolbar && (toolbar.title || toolbar.pageTitle); + console.log('SET TOOLBAR'); }; exp.getTitle = function () { return exp.title; }; diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 1f4eeb218..22ffc8732 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -78,6 +78,7 @@ define([ funcs.displayAvatar = callWithCommon(UI.displayAvatar); funcs.createButton = callWithCommon(UI.createButton); funcs.createUsageBar = callWithCommon(UI.createUsageBar); + funcs.updateTags = callWithCommon(UI.updateTags); // History funcs.getHistory = callWithCommon(History.create); diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 3218f40f4..6433906d6 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -228,7 +228,7 @@ define([ $span.append($rightCol); } else { Common.displayAvatar($span, data.avatar, name, function ($img) { - if (data.avatar && $img) { + if (data.avatar && $img.length) { avatars[data.avatar] = $img[0].outerHTML; } $span.append($rightCol); @@ -448,7 +448,7 @@ define([ var $content = $('
'); $('', {'style':'display:none;'}).appendTo($content); $('

').text(Messages.viewEmbedTitle).appendTo($content); - var $tag = $('

').text(Messages.fileEmbedTag).appendTo($content); + var $tag = $('

').text(Messages.viewEmbedTag).appendTo($content); $('
').appendTo($tag); var iframeId = uid(); var iframeEmbed = ''; diff --git a/www/drive/app-drive.less b/www/drive/app-drive.less index ea027d76e..7b3adf77e 100644 --- a/www/drive/app-drive.less +++ b/www/drive/app-drive.less @@ -6,11 +6,13 @@ @import (once) '../../customize/src/less2/include/leftside-menu.less'; @import (once) "../../customize/src/less2/include/tools.less"; @import (once) "../../customize/src/less2/include/limit-bar.less"; +@import (once) "../../customize/src/less2/include/tokenfield.less"; .toolbar_main(); .fileupload_main(); .alertify_main(); .limit-bar_main(); +.tokenfield_main(); @drive_hover: #eee; @drive_hover-light: lighten(@drive_hover, 20%); @@ -590,7 +592,7 @@ span { margin-right: 5px; } } - &.cp-app-drive-content-icon, &.cp-app-drive-element-state { + &.cp-app-drive-content-icon, &.cp-app-drive-element-state, &.cp-icon { width: 30px; } &.cp-app-drive-element-type, &.cp-app-drive-element-atime, &.cp-app-drive-element-ctime { diff --git a/www/drive/inner.html b/www/drive/inner.html index 7ec8fc651..9761de93c 100644 --- a/www/drive/inner.html +++ b/www/drive/inner.html @@ -25,6 +25,7 @@

  • Delete
  • New folder
  • Properties
  • +
  • Tags