diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 429e2f928..2b50a088d 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -12,6 +12,7 @@ define(function () { out.type.drive = 'Drive'; out.type.whiteboard = "Tableau Blanc"; out.type.file = "Fichier"; + out.type.media = "Média"; out.button_newpad = 'Nouveau document texte'; out.button_newcode = 'Nouvelle page de code'; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 678d3c4fb..6c3ec7c4d 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -12,6 +12,7 @@ define(function () { out.type.drive = 'Drive'; out.type.whiteboard = 'Whiteboard'; out.type.file = 'File'; + out.type.media = 'Media'; out.button_newpad = 'New Rich Text pad'; out.button_newcode = 'New Code pad'; diff --git a/www/common/common-hash.js b/www/common/common-hash.js index 23f5f6a24..620acd319 100644 --- a/www/common/common-hash.js +++ b/www/common/common-hash.js @@ -31,8 +31,8 @@ define([ } return '/1/view/' + hexToBase64(chanKey) + '/'+Crypto.b64RemoveSlashes(keys.viewKeyStr)+'/'; }; - var getFileHashFromKey = Hash.getFileHashFromKey = function (fileKey, cryptKey, type) { - return '/2/' + hexToBase64(fileKey) + '/' + Crypto.b64RemoveSlashes(cryptKey) + '/' + Crypto.base64RemoveSlashes(type); + var getFileHashFromKeys = Hash.getFileHashFromKeys = function (fileKey, cryptKey) { + return '/2/' + hexToBase64(fileKey) + '/' + Crypto.b64RemoveSlashes(cryptKey) + '/'; }; var parsePadUrl = Hash.parsePadUrl = function (href) { @@ -122,9 +122,8 @@ define([ } } else if (version === "2") { // version 2 hashes are to be used for encrypted blobs - var fileId = secret.file = hashArray[2].replace(/-/g, '/'); - var key = secret.key = hashArray[3].replace(/-/g, '/'); - var type = secret.type = hashArray[4].replace(/-/g, '/'); + secret.channel = hashArray[2].replace(/-/g, '/'); + secret.keys = { fileKeyStr: hashArray[3].replace(/-/g, '/') }; } } } @@ -139,6 +138,9 @@ define([ if (secret.keys.viewKeyStr) { hashes.viewHash = getViewHashFromKeys(channel, secret.keys); } + if (secret.keys.fileKeyStr) { + hashes.fileHash = getFileHashFromKeys(channel, secret.keys.fileKeyStr); + } return hashes; }; @@ -187,9 +189,8 @@ Version 2 } if (hashArr[1] && hashArr[1] === '2') { parsed.version = 2; - parsed.file = hashArr[2].replace(/-/g, '/'); + parsed.channel = hashArr[2].replace(/-/g, '/'); parsed.key = hashArr[3].replace(/-/g, '/'); - parsed.type = hashArr[4].replace(/-/g, '/'); return parsed; } return; diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 4162e3dbf..7ff4f2b51 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -205,6 +205,13 @@ define([ }); } } + if (hashes.fileHash) { + options.push({ + tag: 'a', + attributes: {title: Messages.viewShareTitle, 'class': 'fileShare'}, + content: ' ' + Messages.viewShare + }); + } var dropdownConfigShare = { text: $('