Merge branch 'staging' into merge-owned

pull/1/head
yflory 4 years ago
commit b4021bd2b0

@ -1,3 +1,32 @@
# Thylacine's revenge (3.19.1)
Our upcoming 3.20.0 release is planned for July 7th, 2020, but we are once again releasing a minor version featuring some nice bug fixes and usability improvements which are ready to be deployed now. In case you missed [our announcement](https://social.weho.st/@cryptpad/104360490068671089) we are phasing out our usage of the `master` and basing our releases on the `main` branch. For best results we recommend explicitly checking out code by its tag.
New features:
* We've spent a little time making support tickets a little bit easier for both users and admins.
* Users can now label their tickets with a set of predefined categories, making it easier for admins to sort through related reports.
* Users and admins can both attach encrypted uploads to their messages, making it easier to demonstrate a problem with an image, video, or other example file.
* Teams now take advantage of the same "mailbox" functionality that powers user accounts' notification center. Team members with the "viewer" role can now use this feature to share documents with their team using the "share menu" as they already can with other users. Anyone with the ability to add a document to the team's drive will then be able to receive the notification and add the document to the team's drive for them. Going forward we'll use this functionality to implement more behaviour to make teams function more like shared user accounts.
* The "pad creation screen" which is displayed to registered users when they first create a pad will no longer remember the settings used when they last created a pad. While this behaviour was intended to streamline the process of creating documents, in practice it led to some user's documents getting deleted because they didn't realize they were set to automatically expire. If you prefer not to use the defaults (owned, non-expiring) then you'll have to click a few more times to create a document, but we think that's a worthwhile tradeoff to avoid data loss.
Bug fixes:
* Hitting _ctrl-A_ in the drive used to select lots of the page's elements which had no business being selected. Now it will select the contents of the directory currently being displayed.
* Due to some complications in OnlyOffice (which we use for spreadsheets) remote updates made to a sheet were not displayed for users who had opened the document in "view mode". We still don't have the means to apply these remote changes in real-time, but we now prompt users to click a button to refresh the editor (not the full page) to display the latest document state.
* A recent update set the text color of the team chat input to 'white', matching the input's background and making the text unreadable. We patched it to make it black text on a white background.
* We're slowly working on improving keyboard shortcuts for a variety of actions. This time around we fixed a bug that prevented "ESC" from closing an open "tag prompt" interface.
* We noticed that the zip file constructed in the browser when you downloaded a subtree of a shared folder in your drive contained the correct directory structure but did not contain the files that were supposed to be there. This has been fixed.
* Finally, we've tweaked our styles to use more specific CSS selectors to prevent a variety of styles from being accidentally applied to the wrong elements. This should make the platform a little easier to maintain and help us improve the visual consistency of a variety of elements on different pages.
To update from 3.19.0 to 3.19.1:
1. Stop your server
2. Get the latest code with `git checkout 3.19.1`
3. Restart your server
If you're updating from anything other than 3.19.0 you may need other clientside dependencies (available with `bower update` and `npm i`).
# Thylacine release (3.19.0)
## Goals

@ -62,7 +62,7 @@ define([
var imprintUrl = AppConfig.imprint && (typeof(AppConfig.imprint) === "boolean" ?
'/imprint.html' : AppConfig.imprint);
Pages.versionString = "CryptPad v3.19.0 (Thylacine)";
Pages.versionString = "CryptPad v3.19.1 (Thylacine's revenge)";
// used for the about menu
Pages.imprintLink = AppConfig.imprint ? footLink(imprintUrl, 'imprint') : undefined;

@ -3,7 +3,6 @@
@import (reference) "./variables.less";
@import (reference) "./avatar.less";
@import (reference) "./tools.less";
@import (reference) "./buttons.less";
.alertify_main() {
--LessLoader_require: LessLoader_currentFile();
@ -272,7 +271,6 @@
}
}
.buttons_main();
input:not(.form-control), textarea {
margin-bottom: 15px;
}

@ -1,7 +1,6 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
@import (reference) "./avatar.less";
@import (reference) "./buttons.less";
@import (reference) "./tools.less";
.comments_main() {
@ -22,8 +21,6 @@
}
.buttons_main();
.cp-comment-reply {
margin-left: 30px;
}

@ -1,7 +1,7 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
.buttons_main() {
.forms_main() {
@alertify-fore: @colortheme_modal-fg;
@alertify-btn-fg: @alertify-fore;
@alertify-light-bg: fade(@alertify-fore, 25%);
@ -30,7 +30,7 @@
div.cp-alertify-type {
display: flex;
input {
margin: 0;
margin: 0 !important;
flex: 1;
min-width: 0;
}
@ -83,7 +83,7 @@
margin-bottom: 3px !important;
}
button:not(.pure-button):not(.md-button):not(.mdl-button) {
button.btn {
background-color: @colortheme_alertify-cancel;
box-sizing: border-box;

@ -16,6 +16,7 @@
@import (reference) "./cursor.less";
@import (reference) "./usergrid.less";
@import (reference) "./mentions.less";
@import (reference) "./forms.less";
@import (reference) "./modals-ui-elements.less";
.framework_main(@bg-color, @warn-color, @color) {
@ -48,6 +49,7 @@
);
.cursor_main();
.usergrid_main();
.forms_main();
.mentions_main();
.creation_main(
@bg-color: @bg-color,
@ -84,6 +86,7 @@
.checkmark_main(20px);
.password_main();
.usergrid_main();
.forms_main();
font: @colortheme_app-font;
}

@ -1,8 +1,5 @@
@import (reference) "./colortheme-all.less";
@import (reference) "./variables.less";
@import (reference) './buttons.less';
.modal_base() {
font-family: @colortheme_font;
@ -39,8 +36,6 @@
background-color: @colortheme_modal-dim;
.cp-modal {
.buttons_main();
background-color: @colortheme_modal-bg;
color: @colortheme_modal-fg;
box-shadow: @variables_shadow;

@ -1,6 +1,5 @@
@import (reference) "/customize/src/less2/include/colortheme-all.less";
@import (reference) "/customize/src/less2/include/leftside-menu.less";
@import (reference) "/customize/src/less2/include/buttons.less";
@import (reference) "/customize/src/less2/include/browser.less";
@sidebar_button-width: 400px;
@ -98,7 +97,6 @@
}
}
margin-bottom: 20px;
.buttons_main();
}
[type="text"], [type="password"], button {
vertical-align: middle;

@ -84,7 +84,6 @@
width: 100%;
min-width: 100% !important;
&:focus {
border-color: transparent;
outline: 0;
box-shadow: none;
}

@ -2,9 +2,11 @@
@import (reference) "../include/colortheme-all.less";
@import (reference) "../include/alertify.less";
@import (reference) "../include/checkmark.less";
@import (reference) "../include/forms.less";
&.cp-page-register {
.infopages_main();
.forms_main();
.alertify_main();
.checkmark_main(20px);

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "cryptpad",
"version": "3.19.0",
"version": "3.19.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,7 +1,7 @@
{
"name": "cryptpad",
"description": "realtime collaborative visual editor with zero knowlege server",
"version": "3.19.0",
"version": "3.19.1",
"license": "AGPL-3.0+",
"repository": {
"type": "git",

@ -145,12 +145,12 @@ define([
};
dialog.okButton = function (content, classString) {
var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.ok.primary';
var sel = typeof(classString) === 'string'? 'button.ok.' + classString:'button.btn.ok.primary';
return h(sel, { tabindex: '2', }, content || Messages.okButton);
};
dialog.cancelButton = function (content, classString) {
var sel = typeof(classString) === 'string'? 'button.' + classString:'button.cancel';
var sel = typeof(classString) === 'string'? 'button.' + classString:'button.btn.cancel';
return h(sel, { tabindex: '1'}, content || Messages.cancelButton);
};
@ -356,11 +356,15 @@ define([
var $cancel = findCancelButton(tagger).click(function (e) {
close(null, e);
});
listener = listenForKeys(function () {
$ok.click();
}, function () {
$(tagger).on('keydown', function (e) {
if (e.which === 27) {
$cancel.click();
}, tagger);
return;
}
if (e.which === 13) {
$ok.click();
}
});
$(tagger).on('click submit', function (e) {
e.stopPropagation();
@ -392,6 +396,7 @@ define([
buttons.forEach(function (b) {
if (!b.name || !b.onClick) { return; }
var button = h('button', { tabindex: '1', 'class': b.className || '' }, b.name);
button.classList.add('btn');
var todo = function () {
var noClose = b.onClick();
if (noClose) { return; }
@ -642,9 +647,6 @@ define([
var $ok = $(ok).click(function (ev) { close(true, ev); });
var $cancel = $(cancel).click(function (ev) { close(false, ev); });
if (opt.cancelClass) { $cancel.addClass(opt.cancelClass); }
if (opt.okClass) { $ok.addClass(opt.okClass); }
listener = listenForKeys(function () {
$ok.click();
}, function () {

@ -2155,6 +2155,11 @@ define([
'class': 'fa fa-caret-down',
}).prependTo($button);
}
if (config.angleDown) {
$('<span>', {
'class': 'fa fa-angle-down',
}).prependTo($button);
}
// Menu
var $innerblock = $('<div>', {'class': 'cp-dropdown-content'});
@ -2856,6 +2861,7 @@ define([
});
};
/*
UIElements.setExpirationValue = function (val, $expire) {
if (val && typeof (val) === "number") {
$expire.find('#cp-creation-expire').attr('checked', true).trigger('change');
@ -2879,6 +2885,7 @@ define([
$expire.find('#cp-creation-expire-false').attr('checked', true);
}
};
*/
UIElements.getPadCreationScreen = function (common, cfg, appCfg, cb) {
appCfg = appCfg || {};
if (!common.isLoggedIn()) { return void cb(); }
@ -3191,10 +3198,12 @@ define([
// Initial values
/*
if (!cfg.owned && typeof cfg.owned !== "undefined") {
$creation.find('#cp-creation-owned').prop('checked', false);
}
UIElements.setExpirationValue(cfg.expire, $creation);
*/
// Create the pad
var getFormValues = function () {
@ -3544,6 +3553,11 @@ define([
link
]);
var dismiss = function () {
common.mailbox.dismiss(data, function (err) {
console.log(err);
});
};
var answer = function (yes) {
common.mailbox.sendTo("ADD_OWNER_ANSWER", {
channel: msg.content.channel,
@ -3555,9 +3569,7 @@ define([
channel: msg.content.user.notifications,
curvePublic: msg.content.user.curvePublic
});
common.mailbox.dismiss(data, function (err) {
console.log(err);
});
dismiss();
};
var todo = function (yes) {
@ -3572,6 +3584,8 @@ define([
if (err) {
var text = err === "INSUFFICIENT_PERMISSIONS" ? Messages.fm_forbidden
: Messages.error;
console.error(err);
dismiss();
return void UI.warn(text);
}
UI.log(Messages.saved);

@ -4171,7 +4171,8 @@ define([
if (!manager.isSharedFolder(el)) {
name = path.path[path.path.length - 1];
folderEl = el;
downloadFolder(folderEl, name);
var sfId = manager.isInSharedFolder(path.path);
downloadFolder(folderEl, name, sfId);
}
// shared folder
else {

@ -805,7 +805,7 @@ define([
id: 'cp-app-prop-change-password',
style: 'flex: 1;'
});
var passwordOk = h('button', Messages.properties_changePasswordButton);
var passwordOk = h('button.btn', Messages.properties_changePasswordButton);
var changePass = h('span.cp-password-change-container', [
newPassword,
passwordOk

@ -499,7 +499,7 @@ define([
}, 500);
progress(0, 0);*/
}).nThen(function () {
Realtime.whenRealtimeSyncs(store.realtime, Util.bake(cb));
Realtime.whenRealtimeSyncs(store.realtime, Util.mkAsync(Util.bake(cb)));
});
};
});

@ -83,11 +83,6 @@ define([
};
// Share pad
Messages.notification_padSharedTeam = "{0} has shared a pad with the team {2}: <b>{1}</b>"; // XXX
Messages.notification_fileSharedTeam = "{0} has shared a file with the team {2}: <b>{1}</b>"; // XXX
Messages.notification_folderSharedTeam = "{0} has shared a pad with the team {2}: <b>{1}</b>"; // XXX
handlers['SHARE_PAD'] = function(common, data) {
var content = data.content;
var msg = content.msg;

@ -56,6 +56,7 @@ define([
var DISPLAY_RESTORE_BUTTON = false;
var NEW_VERSION = 2;
var PENDING_TIMEOUT = 30000;
var READ_ONLY_REFRESH_DATA_DELAY = 15000;
var debug = function (x) {
if (!window.CP_DEV_MODE) { return; }
@ -558,8 +559,6 @@ define([
xhr.send(null);
};
Messages.oo_refresh = "Refresh"; // XXX read-only corner popup when receiving remote updates
Messages.oo_refreshText = "out of date"; // XXX read-only corner popup when receiving remote updates
var refreshReadOnly = function () {
var cancel = h('button.cp-corner-cancel', Messages.cancel);
var reload = h('button.cp-corner-primary', [
@ -619,8 +618,8 @@ Messages.oo_refreshText = "out of date"; // XXX read-only corner popup when rece
APP.refreshPopup = true;
// Don't "spam" the user instantly and no more than
// 1 popup every 30s
setTimeout(refreshReadOnly, 30000);
// 1 popup every 15s
setTimeout(refreshReadOnly, READ_ONLY_REFRESH_DATA_DELAY);
return;
}
ooChannel.send(obj.data.msg);
@ -1124,6 +1123,9 @@ Messages.oo_refreshText = "out of date"; // XXX read-only corner popup when rece
if (ifr) { ifr.remove(); }
};
APP.UploadImageFiles = function (files, type, id, jwt, cb) {
cb('NO');
};
APP.AddImage = function(cb1, cb2) {
APP.AddImageSuccessCallback = cb1;
APP.AddImageErrorCallback = cb2;

@ -624,10 +624,10 @@ url+'" method="POST" enctype="multipart/form-data"><input id="apiiuFile" name="a
ValidateUploadImage(e.target.files);if(c_oAscServerError.NoError!=nError){callbackOld(mapAscServerErrorToAscError(nError));return}}callbackOld(Asc.c_oAscError.ID.No);fileSubmit.click()}}if(AscBrowser.isOpera)setTimeout(function(){fileName.click()},0);else fileName.click()}function InitDragAndDrop(oHtmlElement,callback){if("undefined"!=typeof FileReader&&null!=oHtmlElement){oHtmlElement["ondragover"]=function(e){e.preventDefault();e.dataTransfer.dropEffect=CanDropFiles(e)?"copy":"none";if(e.dataTransfer.dropEffect==
"copy"){var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;editor.beginInlineDropTarget(e)}return false};oHtmlElement["ondrop"]=function(e){e.preventDefault();var files=e.dataTransfer.files;var nError=ValidateUploadImage(files);var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;editor.endInlineDropTarget(e);if(nError==c_oAscServerError.UploadCountFiles){try{var htmlValue=e.dataTransfer.getData("text/html");if(htmlValue&&!AscCommon.AscBrowser.isIE){var index=
htmlValue.indexOf("StartHTML");var indexHtml=htmlValue.indexOf("<html");if(-1==indexHtml)indexHtml=htmlValue.indexOf("<HTML");if(index>0&&indexHtml>0&&index<indexHtml)htmlValue=htmlValue.substr(indexHtml);editor["pluginMethod_PasteHtml"](htmlValue);return}}catch(err){}try{var textValue=e.dataTransfer.getData("text/plain");if(textValue){editor["pluginMethod_PasteText"](textValue);return}}catch(err$11){}try{var textValue=e.dataTransfer.getData("Text");if(textValue){editor["pluginMethod_PasteText"](textValue);
return}}catch(err$12){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,callback);return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=
[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);
xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId,
jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i,
return}}catch(err$12){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);
var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+=
"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,
documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i,
url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",
file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i<length;i++){var file=files[i];var sName=file.fileName||file.name;if(sName){var bSupported=false;var ext=GetFileExtension(sName);if(null!==ext)for(var j=0,length2=c_oAscImageUploadProp.SupportedFormats.length;j<length2;j++)if(c_oAscImageUploadProp.SupportedFormats[j]==
ext){bSupported=true;break}if(false==bSupported)nRes=c_oAscServerError.UploadExtension}if(Asc.c_oAscError.ID.No==nRes){var nSize=file.fileSize||file.size;if(nSize&&c_oAscImageUploadProp.MaxFileSize<nSize)nRes=c_oAscServerError.UploadContentLength}if(c_oAscServerError.NoError!=nRes)break}else nRes=c_oAscServerError.UploadCountFiles;return nRes}function CanDropFiles(event){var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;if(!editor.isEnabledDropTarget())return false;var bRes=

@ -9413,11 +9413,11 @@ newCDocument;drawingObject.graphicObject.graphicObject.Set_Parent(newCDocument);
node,isIntoShape);else window["AscCommon"].g_specialPasteHelper.Paste_Process_End()};worksheet.objectRender.controller.checkSelectedObjectsAndCallback2(callback);return}if(copyPasteUseBinary){this.activeRange=worksheet.model.selectionRange.getLast().clone();binaryResult=this._pasteFromBinaryClassHtml(worksheet,node,isIntoShape);if(binaryResult===true)return;else if(binaryResult!==false&&binaryResult!=undefined)node=binaryResult}this.activeRange=worksheet.model.selectionRange.getLast().clone();var callBackAfterLoadImages=
function(){History.TurnOff();var oTempDrawingDocument=worksheet.model.DrawingDocument;var newCDocument=new CDocument(oTempDrawingDocument,false);newCDocument.bFromDocument=true;newCDocument.Content[0].bFromDocument=true;newCDocument.theme=window["Asc"]["editor"].wbModel.theme;var oOldLogicDocument=oTempDrawingDocument.m_oLogicDocument;oTempDrawingDocument.m_oLogicDocument=newCDocument;var oOldEditor=undefined;if("undefined"!==typeof editor)oOldEditor=editor;editor={WordControl:oTempDrawingDocument,
isDocumentEditor:true};var oPasteProcessor=new AscCommon.PasteProcessor({WordControl:{m_oLogicDocument:newCDocument},FontLoader:{}},false,false);oPasteProcessor._Prepeare_recursive(node,true,true);if(window["AscCommon"].g_specialPasteHelper.specialPasteStart&&window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent)oPasteProcessor.aContent=window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent;else{oPasteProcessor._Execute(node,{},true,true,false);window["AscCommon"].g_specialPasteHelper.specialPasteData.aContent=
oPasteProcessor.aContent}editor=oOldEditor;oTempDrawingDocument.m_oLogicDocument=oOldLogicDocument;History.TurnOn();var oPasteFromBinaryWord=new pasteFromBinaryWord(t,worksheet);oPasteFromBinaryWord._paste(worksheet,{content:oPasteProcessor.aContent})};var aImagesToDownload=this._getImageFromHtml(node,true);var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps;if(aImagesToDownload!==null&&(!specialPasteProps||specialPasteProps&&specialPasteProps.images)){var api=Asc["editor"];
AscCommon.sendImgUrls(api,aImagesToDownload,function(data){for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=aImagesToDownload[i];if(null!=elem.url)t.oImages[sFrom]=AscCommon.g_oDocumentUrls.imagePath2Local(elem.path);else t.oImages[sFrom]=sFrom}t.alreadyLoadImagesOnServer=true;callBackAfterLoadImages()},true)}else callBackAfterLoadImages()},_pasteFromBinaryClassHtml:function(worksheet,node,isIntoShape){var base64=null,base64FromWord=null,base64FromPresentation=
null,t=this;var returnBinary=this._getClassBinaryFromHtml(node);base64=returnBinary.base64;base64FromWord=returnBinary.base64FromWord;base64FromPresentation=returnBinary.base64FromPresentation;var result=false;if(base64!=null)result=this._pasteFromBinaryExcel(worksheet,base64,isIntoShape);else if(base64FromWord)result=this._pasteFromBinaryWord(worksheet,base64FromWord,isIntoShape);else if(base64FromPresentation)result=this._pasteFromBinaryPresentation(worksheet,base64FromPresentation,isIntoShape);
return result},_getClassBinaryFromHtml:function(node){var base64=null,base64FromWord=null,base64FromPresentation=null;var classNode=AscCommon.searchBinaryClass(node);if(classNode!=null){var cL=classNode.split(" ");for(var i=0;i<cL.length;i++)if(cL[i].indexOf("xslData;")>-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64,base64FromWord:base64FromWord,
base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i<allImages.length;i++)arrayImages[i]=allImages[i].src;res=arrayImages}else res=allImages}return res},_getBinaryColor:function(c){var bin,m,x,type,r,g,b,a,s;var reColor=/^\s*(?:#?([0-9a-f]{6})|#?([0-9a-f]{3})|rgba?\s*\(\s*((?:\d*\.?\d+)(?:\s*,\s*(?:\d*\.?\d+)){2,3})\s*\))\s*$/i;
oPasteProcessor.aContent}editor=oOldEditor;oTempDrawingDocument.m_oLogicDocument=oOldLogicDocument;History.TurnOn();var oPasteFromBinaryWord=new pasteFromBinaryWord(t,worksheet);oPasteFromBinaryWord._paste(worksheet,{content:oPasteProcessor.aContent})};var aImagesToDownload=this._getImageFromHtml(node,true);if(aImagesToDownload)return;var specialPasteProps=window["AscCommon"].g_specialPasteHelper.specialPasteProps;if(aImagesToDownload!==null&&(!specialPasteProps||specialPasteProps&&specialPasteProps.images)){var api=
Asc["editor"];AscCommon.sendImgUrls(api,aImagesToDownload,function(data){for(var i=0,length=Math.min(data.length,aImagesToDownload.length);i<length;++i){var elem=data[i];var sFrom=aImagesToDownload[i];if(null!=elem.url)t.oImages[sFrom]=AscCommon.g_oDocumentUrls.imagePath2Local(elem.path);else t.oImages[sFrom]=sFrom}t.alreadyLoadImagesOnServer=true;callBackAfterLoadImages()},true)}else callBackAfterLoadImages()},_pasteFromBinaryClassHtml:function(worksheet,node,isIntoShape){var base64=null,base64FromWord=
null,base64FromPresentation=null,t=this;var returnBinary=this._getClassBinaryFromHtml(node);base64=returnBinary.base64;base64FromWord=returnBinary.base64FromWord;base64FromPresentation=returnBinary.base64FromPresentation;var result=false;if(base64!=null)result=this._pasteFromBinaryExcel(worksheet,base64,isIntoShape);else if(base64FromWord)result=this._pasteFromBinaryWord(worksheet,base64FromWord,isIntoShape);else if(base64FromPresentation)result=this._pasteFromBinaryPresentation(worksheet,base64FromPresentation,
isIntoShape);return result},_getClassBinaryFromHtml:function(node){var base64=null,base64FromWord=null,base64FromPresentation=null;var classNode=AscCommon.searchBinaryClass(node);if(classNode!=null){var cL=classNode.split(" ");for(var i=0;i<cL.length;i++)if(cL[i].indexOf("xslData;")>-1)base64=cL[i].split("xslData;")[1];else if(cL[i].indexOf("docData;")>-1)base64FromWord=cL[i].split("docData;")[1];else if(cL[i].indexOf("pptData;")>-1)base64FromPresentation=cL[i].split("pptData;")[1]}return{base64:base64,
base64FromWord:base64FromWord,base64FromPresentation:base64FromPresentation}},_getImageFromHtml:function(html,isGetUrlsArray){var res=null;if(html){var allImages=html.getElementsByTagName("img");if(allImages&&allImages.length)if(isGetUrlsArray){var arrayImages=[];for(var i=0;i<allImages.length;i++)arrayImages[i]=allImages[i].src;res=arrayImages}else res=allImages}return res},_getBinaryColor:function(c){var bin,m,x,type,r,g,b,a,s;var reColor=/^\s*(?:#?([0-9a-f]{6})|#?([0-9a-f]{3})|rgba?\s*\(\s*((?:\d*\.?\d+)(?:\s*,\s*(?:\d*\.?\d+)){2,3})\s*\))\s*$/i;
if(typeof c==="number")bin=c;else{m=reColor.exec(c);if(!m)return null;if(m[1]){x=[m[1].slice(0,2),m[1].slice(2,4),m[1].slice(4)];type=1}else if(m[2]){x=[m[2].slice(0,1),m[2].slice(1,2),m[2].slice(2)];type=0}else{x=m[3].split(/\s*,\s*/i);type=x.length===3?2:3}r=parseInt(type!==0?x[0]:x[0]+x[0],type<2?16:10);g=parseInt(type!==0?x[1]:x[1]+x[1],type<2?16:10);b=parseInt(type!==0?x[2]:x[2]+x[2],type<2?16:10);a=type===3?Math.round(parseFloat(x[3])*100)*.01:1;bin=r<<16|g<<8|b}return bin},_checkMaxTextLength:function(aResult,
r,c){var result=false;var isChange=false;var currentCellData=aResult.content[r][c];if(currentCellData&&currentCellData.content){currentCellData=currentCellData.content;for(var i=0;i<currentCellData.length;i++)if(currentCellData[i]&&currentCellData[i].text&&currentCellData[i].text.length>c_oAscMaxCellOrCommentLength){isChange=true;var text=currentCellData[i].text;var format=currentCellData[i].format;var lengthOfText=text.length;var iterCount=Math.ceil(lengthOfText/c_oAscMaxCellOrCommentLength);var splitText;
for(var j=0;j<iterCount;j++){splitText=text.substr(c_oAscMaxCellOrCommentLength*j,c_oAscMaxCellOrCommentLength*(j+1));if(!aResult.content[r])aResult.content[r]=[];if(!aResult.content[r][c])aResult.content[r][c]=[];if(!aResult.content[r][c].content)aResult.content[r][c].content=[];aResult.content[r][c].content[0]={format:format,text:splitText};if(iterCount!==j+1)r++}}if(isChange)result={aResult:aResult,r:r,c:c}}return result},_getBorderStyleName:function(borderStyle,borderWidth){var res=null;var nBorderWidth=

@ -622,10 +622,10 @@ url+'" method="POST" enctype="multipart/form-data"><input id="apiiuFile" name="a
ValidateUploadImage(e.target.files);if(c_oAscServerError.NoError!=nError){callbackOld(mapAscServerErrorToAscError(nError));return}}callbackOld(Asc.c_oAscError.ID.No);fileSubmit.click()}}if(AscBrowser.isOpera)setTimeout(function(){fileName.click()},0);else fileName.click()}function InitDragAndDrop(oHtmlElement,callback){if("undefined"!=typeof FileReader&&null!=oHtmlElement){oHtmlElement["ondragover"]=function(e){e.preventDefault();e.dataTransfer.dropEffect=CanDropFiles(e)?"copy":"none";if(e.dataTransfer.dropEffect==
"copy"){var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;editor.beginInlineDropTarget(e)}return false};oHtmlElement["ondrop"]=function(e){e.preventDefault();var files=e.dataTransfer.files;var nError=ValidateUploadImage(files);var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;editor.endInlineDropTarget(e);if(nError==c_oAscServerError.UploadCountFiles){try{var htmlValue=e.dataTransfer.getData("text/html");if(htmlValue&&!AscCommon.AscBrowser.isIE){var index=
htmlValue.indexOf("StartHTML");var indexHtml=htmlValue.indexOf("<html");if(-1==indexHtml)indexHtml=htmlValue.indexOf("<HTML");if(index>0&&indexHtml>0&&index<indexHtml)htmlValue=htmlValue.substr(indexHtml);editor["pluginMethod_PasteHtml"](htmlValue);return}}catch(err){}try{var textValue=e.dataTransfer.getData("text/plain");if(textValue){editor["pluginMethod_PasteText"](textValue);return}}catch(err$16){}try{var textValue=e.dataTransfer.getData("Text");if(textValue){editor["pluginMethod_PasteText"](textValue);
return}}catch(err$17){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,callback);return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=
[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);
xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId,
jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i,
return}}catch(err$17){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);
var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+=
"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,
documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i,
url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",
file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i<length;i++){var file=files[i];var sName=file.fileName||file.name;if(sName){var bSupported=false;var ext=GetFileExtension(sName);if(null!==ext)for(var j=0,length2=c_oAscImageUploadProp.SupportedFormats.length;j<length2;j++)if(c_oAscImageUploadProp.SupportedFormats[j]==
ext){bSupported=true;break}if(false==bSupported)nRes=c_oAscServerError.UploadExtension}if(Asc.c_oAscError.ID.No==nRes){var nSize=file.fileSize||file.size;if(nSize&&c_oAscImageUploadProp.MaxFileSize<nSize)nRes=c_oAscServerError.UploadContentLength}if(c_oAscServerError.NoError!=nRes)break}else nRes=c_oAscServerError.UploadCountFiles;return nRes}function CanDropFiles(event){var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;if(!editor.isEnabledDropTarget())return false;var bRes=

@ -622,10 +622,10 @@ url+'" method="POST" enctype="multipart/form-data"><input id="apiiuFile" name="a
ValidateUploadImage(e.target.files);if(c_oAscServerError.NoError!=nError){callbackOld(mapAscServerErrorToAscError(nError));return}}callbackOld(Asc.c_oAscError.ID.No);fileSubmit.click()}}if(AscBrowser.isOpera)setTimeout(function(){fileName.click()},0);else fileName.click()}function InitDragAndDrop(oHtmlElement,callback){if("undefined"!=typeof FileReader&&null!=oHtmlElement){oHtmlElement["ondragover"]=function(e){e.preventDefault();e.dataTransfer.dropEffect=CanDropFiles(e)?"copy":"none";if(e.dataTransfer.dropEffect==
"copy"){var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;editor.beginInlineDropTarget(e)}return false};oHtmlElement["ondrop"]=function(e){e.preventDefault();var files=e.dataTransfer.files;var nError=ValidateUploadImage(files);var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;editor.endInlineDropTarget(e);if(nError==c_oAscServerError.UploadCountFiles){try{var htmlValue=e.dataTransfer.getData("text/html");if(htmlValue&&!AscCommon.AscBrowser.isIE){var index=
htmlValue.indexOf("StartHTML");var indexHtml=htmlValue.indexOf("<html");if(-1==indexHtml)indexHtml=htmlValue.indexOf("<HTML");if(index>0&&indexHtml>0&&index<indexHtml)htmlValue=htmlValue.substr(indexHtml);editor["pluginMethod_PasteHtml"](htmlValue);return}}catch(err){}try{var textValue=e.dataTransfer.getData("text/plain");if(textValue){editor["pluginMethod_PasteText"](textValue);return}}catch(err$1){}try{var textValue=e.dataTransfer.getData("Text");if(textValue){editor["pluginMethod_PasteText"](textValue);
return}}catch(err$2){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,callback);return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=
[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);
xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,documentId,documentUserId,
jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i,
return}}catch(err$2){}}callback(mapAscServerErrorToAscError(nError),files)}}}function UploadImageFiles(files,documentId,documentUserId,jwt,callback){window.parent.APP.UploadImageFiles(files,documentId,documentUserId,jwt,function(err,urls){callback(err||Asc.c_oAscError.ID.No,urls)});return;if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);
var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push(urls[i]);break}if(aFiles.length===0)callback(Asc.c_oAscError.ID.No,aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+=
"?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback(Asc.c_oAscError.ID.UplImageFileCount)};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function UploadImageUrls(files,
documentId,documentUserId,jwt,callback){if(files.length>0){var url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);var aFiles=[];for(var i=files.length-1;i>-1;--i)aFiles.push(files[i]);var file=aFiles.pop();var aResultUrls=[];var fOnReadyChnageState=function(){if(4==this.readyState)if(this.status==200||this.status==1223){var urls=JSON.parse(this.responseText);g_oDocumentUrls.addUrls(urls);for(var i in urls)if(urls.hasOwnProperty(i)){aResultUrls.push({path:i,
url:urls[i]});break}if(aFiles.length===0)callback(aResultUrls);else{file=aFiles.pop();var xhr=new XMLHttpRequest;url=sUploadServiceLocalUrl+"/"+documentId+"/"+documentUserId+"/"+g_oDocumentUrls.getMaxIndex();if(jwt)url+="?token="+encodeURIComponent(jwt);xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}}else callback([])};var xhr=new XMLHttpRequest;xhr.open("POST",url,true);xhr.setRequestHeader("Content-Type",
file.type||"application/octet-stream");xhr.onreadystatechange=fOnReadyChnageState;xhr.send(file)}else callback(Asc.c_oAscError.ID.UplImageFileCount)}function ValidateUploadImage(files){var nRes=c_oAscServerError.NoError;if(files.length>0)for(var i=0,length=files.length;i<length;i++){var file=files[i];var sName=file.fileName||file.name;if(sName){var bSupported=false;var ext=GetFileExtension(sName);if(null!==ext)for(var j=0,length2=c_oAscImageUploadProp.SupportedFormats.length;j<length2;j++)if(c_oAscImageUploadProp.SupportedFormats[j]==
ext){bSupported=true;break}if(false==bSupported)nRes=c_oAscServerError.UploadExtension}if(Asc.c_oAscError.ID.No==nRes){var nSize=file.fileSize||file.size;if(nSize&&c_oAscImageUploadProp.MaxFileSize<nSize)nRes=c_oAscServerError.UploadContentLength}if(c_oAscServerError.NoError!=nRes)break}else nRes=c_oAscServerError.UploadCountFiles;return nRes}function CanDropFiles(event){var editor=window["Asc"]["editor"]?window["Asc"]["editor"]:window.editor;if(!editor.isEnabledDropTarget())return false;var bRes=

@ -209,7 +209,6 @@ proxy.mailboxes = {
delete ctx.boxes[type];
};
var openChannel = function (ctx, type, m, onReady, opts) {
console.error(type, m, opts);
opts = opts || {};
var box = ctx.boxes[type] = {
channel: m.channel,

@ -798,7 +798,6 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) {
return void console.error(err);
}
metadata = ref.internal.metadata = (data && data[0]) || undefined;
console.log("TEAM_METADATA", metadata);
});
}).nThen(function (w) {
if (!config.keys.teamEdPublic && metadata && metadata.validateKey) {

@ -175,6 +175,23 @@ define([
Pinpad.create(ctx.store.network, data, function (e, call) {
if (e) { return void cb(e); }
team.rpc = call;
team.pin = function (data, cb) {
if (!team.rpc) { return void cb({error: 'TEAM_RPC_NOT_READY'}); }
if (typeof(cb) !== 'function') { console.error('expected a callback'); }
team.rpc.pin(data, function (e, hash) {
if (e) { return void cb({error: e}); }
cb({hash: hash});
});
};
team.unpin = function (data, cb) {
if (!team.rpc) { return void cb({error: 'TEAM_RPC_NOT_READY'}); }
if (typeof(cb) !== 'function') { console.error('expected a callback'); }
team.rpc.unpin(data, function (e, hash) {
if (e) { return void cb({error: e}); }
cb({hash: hash});
});
};
cb();
});
});
@ -245,27 +262,7 @@ define([
nThen(function (waitFor) {
// Init Team RPC
if (!keys.drive.edPrivate) { return; }
initRpc(ctx, team, keys.drive, waitFor(function (err) {
if (err) { return; }
team.pin = function (data, cb) {
if (!team.rpc) { return void cb({error: 'TEAM_RPC_NOT_READY'}); }
if (typeof(cb) !== 'function') { console.error('expected a callback'); }
team.rpc.pin(data, function (e, hash) {
if (e) { return void cb({error: e}); }
cb({hash: hash});
});
};
team.unpin = function (data, cb) {
if (!team.rpc) { return void cb({error: 'TEAM_RPC_NOT_READY'}); }
if (typeof(cb) !== 'function') { console.error('expected a callback'); }
team.rpc.unpin(data, function (e, hash) {
if (e) { return void cb({error: e}); }
cb({hash: hash});
});
};
}));
initRpc(ctx, team, keys.drive, waitFor(function () {}));
}).nThen(function () {
// Create the proxy manager
var loadSharedFolder = function (id, data, cb, isNew) {
@ -474,6 +471,16 @@ define([
// Make sure we have not been kicked from the roster
var state = roster.getState();
var me = Util.find(ctx, ['store', 'proxy', 'curvePublic']);
// XXX FIXME roster history temporarily corrupted, don't leave the team
if (!state.members || !Object.keys(state.members).length) {
lm.stop();
roster.stop();
lm.proxy = {};
cb({error: 'EINVAL'});
waitFor.abort();
console.error(JSON.stringify(state));
return;
}
if (!state.members[me]) {
lm.stop();
roster.stop();
@ -1122,6 +1129,7 @@ define([
teamData.hash = data.hash;
teamData.keys.drive.edPrivate = data.keys.drive.edPrivate;
teamData.keys.chat.edit = data.keys.chat.edit;
initRpc(ctx, team, teamData.keys.drive, function () {});
var secret = Hash.getSecrets('team', data.hash, teamData.password);
team.secondaryKey = secret && secret.keys.secondaryKey;
@ -1130,6 +1138,9 @@ define([
delete teamData.keys.drive.edPrivate;
delete teamData.keys.chat.edit;
delete team.secondaryKey;
if (team.rpc && team.rpc.destroy) {
team.rpc.destroy();
}
}
updateMyRights(ctx, teamId, data.hash);
@ -1660,6 +1671,7 @@ define([
var safe = false;
if (['drive', 'teams', 'settings'].indexOf(app) !== -1) { safe = true; }
Object.keys(teams).forEach(function (id) {
if (!ctx.teams[id]) { return; }
t[id] = {
owner: teams[id].owner,
name: teams[id].metadata.name,
@ -1716,6 +1728,15 @@ define([
team.removeClient = function (clientId) {
removeClient(ctx, clientId);
};
var listTeams = function (cb) {
var t = Util.clone(teams);
Object.keys(t).forEach(function (id) {
// If failure to load the team, don't send it
if (ctx.teams[id]) { return; }
t[id].error = true;
});
cb(t);
};
team.execCommand = function (clientId, obj, cb) {
if (ctx.store.offline) {
return void cb({ error: 'OFFLINE' });
@ -1728,7 +1749,7 @@ define([
return void subscribe(ctx, data, clientId, cb);
}
if (cmd === 'LIST_TEAMS') {
return void cb(store.proxy.teams);
return void listTeams(cb);
}
if (cmd === 'OPEN_TEAM_CHAT') {
return void openTeamChat(ctx, data, clientId, cb);

@ -490,6 +490,7 @@ define([
}, {
typeInput: $select[0]
});
$select.find('button').addClass('btn');
});
toolbar.$drawer.append($export);
};

@ -144,7 +144,6 @@ define([
var onMessage = function (data, cb) {
// data = { type: 'type', content: {msg: 'msg', hash: 'hash'} }
console.debug(data.type, data.content);
pushMessage(data);
if (data.content && typeof (data.content.getFormatText) === "function") {
var text = $('<div>').html(data.content.getFormatText()).text();
@ -188,7 +187,6 @@ define([
onMessageHandlers.push(function (data, el) {
var type = data.type;
if (types.indexOf(type) === -1 && !(teams && /^team-/.test(type))) { return; }
console.log('okokok');
cfg.onMessage(data, el);
});
}

@ -1027,7 +1027,6 @@ MessengerUI, Messages) {
Common.mailbox.subscribe(['notifications', 'team'], {
onMessage: function (data, el) {
console.log(data, el, div);
if (el) {
$(div).prepend(el);
}

@ -21,7 +21,7 @@
"button_newslide": "Neue Präsentation",
"button_newwhiteboard": "Neues Whiteboard",
"button_newkanban": "Neues Kanban",
"common_connectionLost": "<b>Die Verbindung zum Server ist abgebrochen</b><br>Du verwendest jetzt das Dokument schreibgeschützt, bis die Verbindung wieder funktioniert.",
"common_connectionLost": "<b>Die Verbindung zum Server ist abgebrochen</b><br>Du kannst das Dokument nicht bearbeiten, bis die Verbindung wieder funktioniert.",
"websocketError": "Verbindung zum Websocket fehlgeschlagen...",
"typeError": "Dieses Dokument ist nicht mit der ausgewählten Anwendung kompatibel",
"onLogout": "Du bist ausgeloggt. {0}Klicke hier{1}, um dich wieder einzuloggen,<br>oder drücke <em>Escape</em>, um dein Pad schreibgeschützt zu benutzen.",
@ -1087,7 +1087,7 @@
"support_disabledTitle": "Support ist nicht aktiviert",
"support_disabledHint": "Diese CryptPad-Instanz wurde noch nicht für die Verwendung eines Support-Formulars konfiguriert.",
"support_cat_new": "Neues Ticket",
"support_formTitle": "Titel des Tickets",
"support_formTitle": "Neues Ticket",
"support_formHint": "Mit diesem Formular kann ein neues Support-Ticket eröffnet werden. Es erlaubt die sichere Kontaktaufnahme mit den Administratoren zur Lösung von Problemen oder Beantwortung von Fragen. Bitte eröffne kein neues Ticket, wenn du bereits ein offenes Ticket bezüglich des gleichen Problems hast. Verwende stattdessen die Antworten-Schaltfläche, um weitere Informationen hinzuzufügen.",
"support_formButton": "Absenden",
"support_formTitleError": "Fehler: Titel ist leer",
@ -1123,7 +1123,7 @@
"properties_unknownUser": "{0} unbekannte(r) Benutzer",
"fm_morePads": "Mehr",
"fc_openInCode": "Im Code-Editor öffnen",
"uploadFolder_modal_title": "Optionen für Ordnerupload",
"uploadFolder_modal_title": "Optionen für Hochladen des Ordners",
"uploadFolder_modal_filesPassword": "Passwort für Dateien",
"uploadFolder_modal_owner": "Eigene Dateien",
"uploadFolder_modal_forceSave": "Dateien im CryptDrive speichern",
@ -1181,7 +1181,7 @@
"team_rosterPromote": "Befördern",
"team_rosterDemote": "Degradieren",
"team_rosterKick": "Aus dem Team entfernen",
"team_inviteButton": "Kontakte einladen",
"team_inviteButton": "Mitglieder einladen",
"team_leaveButton": "Dieses Team verlassen",
"team_leaveConfirm": "Wenn du dieses Team verlässt, verlierst du den Zugriff auf das dazugehörige CryptDrive, den Chatverlauf und andere Inhalte. Bist du sicher?",
"team_owner": "Eigentümer",
@ -1381,5 +1381,18 @@
"settings_safeLinkDefault": "Sichere Links sind nun standardmäßig aktiviert. Bitte verwende zum Kopieren von Links das Menü <i class=\"fa fa-shhare-alt\"></i> <b>Teilen</b> und nicht die Adressleiste des Browsers.",
"info_imprintFlavour": "<a>Rechtliche Informationen über die Administratoren dieses Servers</a>.",
"info_privacyFlavour": "Unsere <a>Datenschutzerklärung</a> beschreibt, wie wir deine Daten verarbeiten.",
"user_about": "Über CryptPad"
"user_about": "Über CryptPad",
"support_cat_all": "Alle",
"support_cat_other": "Anderes",
"support_cat_account": "Benutzerkonto",
"support_cat_data": "Datenverlust",
"notification_folderSharedTeam": "{0} hat einen Ordner mit dem Team {2} geteilt: <b>{1}</b>",
"notification_fileSharedTeam": "{0} hat eine Datei mit dem Team {2} geteilt: <b>{1}</b>",
"notification_padSharedTeam": "{0} hat ein Pad mit dem Team {2} geteilt: <b>{1}</b>",
"support_addAttachment": "Anhang hinzufügen",
"support_attachments": "Anhänge",
"support_cat_bug": "Fehlerbericht",
"oo_refresh": "Neu laden",
"support_category": "Wähle eine Kategorie",
"oo_refreshText": "Dieses Dokument wurde aktualisiert"
}

@ -1086,7 +1086,7 @@
"support_disabledTitle": "Le support n'est pas activé",
"support_disabledHint": "Cette instance de CryptPad n'est pas encore configurée pour utiliser le formulaire de support.",
"support_cat_new": "Nouveau ticket",
"support_formTitle": "Titre du ticket",
"support_formTitle": "Nouveau Ticket",
"support_formButton": "Envoyer",
"support_formTitleError": "Erreur : le titre est vide",
"support_formContentError": "Erreur : le contenu est vide",
@ -1164,7 +1164,7 @@
"team_inviteModalButton": "Inviter",
"team_pcsSelectLabel": "Sauver dans",
"team_pcsSelectHelp": "Créer un pad dans le drive d'une équipe rend cette équipe propriétaire du pad si l'option est cochée.",
"team_invitedToTeam": "{0} vous à inviter à rejoindre l'équipe : <b>{1}</b>",
"team_invitedToTeam": "{0} vous a invité à rejoindre l'équipe : <b>{1}</b>",
"team_kickedFromTeam": "{0} vous a exclu de l'équipe : <b>{1}</b>",
"team_acceptInvitation": "{0} a accepté votre offre de rejoindre l'équipe : <b>{1}</b>",
"team_declineInvitation": "{0} a refusé votre offre de rejoindre l'équipe : <b>{1}</b>",
@ -1183,7 +1183,7 @@
"team_rosterPromote": "Promouvoir",
"team_rosterDemote": "Rétrograder",
"team_rosterKick": "Expulser de l'équipe",
"team_inviteButton": "Inviter des contacts",
"team_inviteButton": "Inviter des membres",
"team_leaveButton": "Quitter cette équipe",
"team_leaveConfirm": "Si vous quittez cette équipe, vous perdrez l'accès à son CryptDrive, son chat et les autres contenus. Êtes-vous sûr ?",
"team_owner": "Propriétaires",
@ -1381,5 +1381,18 @@
"support_languagesPreamble": "L'équipe de support parle les langues suivantes :",
"info_privacyFlavour": "<a>Description de la confidentialité</a> de vos données.",
"user_about": "À propos de CryptPad",
"info_imprintFlavour": "<a>Informations légales sur les administateurs de cette instance</a>."
"info_imprintFlavour": "<a>Informations légales sur les administateurs de cette instance</a>.",
"support_cat_all": "Tout",
"support_cat_other": "Autre",
"support_cat_bug": "Rapport de bug",
"support_cat_data": "Perte de données",
"support_cat_account": "Compte utilisateur",
"notification_folderSharedTeam": "{0} a partagé un dossier avec l'équipe {2} : <b>{1}</b>",
"notification_fileSharedTeam": "{0} a partagé un fichier avec l'équipe {2} : <b>{1}</b>",
"notification_padSharedTeam": "{0} a partagé un pad avec l'équipe {2} : <b>{1}</b>",
"support_addAttachment": "Ajouter une pièce jointe",
"support_attachments": "Pièces jointes",
"oo_refreshText": "Ce document a été mis à jour",
"oo_refresh": "Recharger",
"support_category": "Choisir une catégorie"
}

@ -1108,7 +1108,7 @@
"support_disabledTitle": "Support is not enabled",
"support_disabledHint": "This CryptPad instance is not yet configured to use a support form.",
"support_cat_new": "New ticket",
"support_formTitle": "Ticket title",
"support_formTitle": "New Ticket",
"support_formHint": "This form can be used to create a new support ticket. Use it to contact the administrators to solve issues or ask any question in a secure way. Please don't create a new ticket if you already have an open ticket about the same issue, but use the reply button to provide more information.",
"support_formButton": "Send",
"support_formTitleError": "Error: title is empty",
@ -1187,7 +1187,7 @@
"team_rosterPromote": "Promote",
"team_rosterDemote": "Demote",
"team_rosterKick": "Kick from the team",
"team_inviteButton": "Invite contacts",
"team_inviteButton": "Invite members",
"team_leaveButton": "Leave this team",
"team_leaveConfirm": "If you leave this team you will lose access to its CryptDrive, chat history, and other contents. Are you sure?",
"team_owner": "Owners",
@ -1381,5 +1381,18 @@
"settings_safeLinkDefault": "Safe Links are now turned on by default. Please use the <i class=\"fa fa-shhare-alt\"></i> <b>Share</b> menu to copy links rather than your browser's address bar.",
"info_imprintFlavour": "<a>Legal information about the administrators of this instance</a>.",
"user_about": "About CryptPad",
"info_privacyFlavour": "Our <a>privacy policy</a> describes how we treat your data."
"info_privacyFlavour": "Our <a>privacy policy</a> describes how we treat your data.",
"support_cat_account": "User account",
"support_cat_data": "Loss of content",
"support_cat_bug": "Bug report",
"support_cat_other": "Other",
"support_cat_all": "All",
"support_attachments": "Attachments",
"support_addAttachment": "Add attachment",
"notification_padSharedTeam": "{0} has shared a pad with the team {2}: <b>{1}</b>",
"notification_fileSharedTeam": "{0} has shared a file with the team {2}: <b>{1}</b>",
"notification_folderSharedTeam": "{0} has shared a folder with the team {2}: <b>{1}</b>",
"oo_refresh": "Refresh",
"oo_refreshText": "This document has been updated",
"support_category": "Choose a category"
}

@ -1,7 +1,6 @@
@import (reference) '../../customize/src/less2/include/framework.less';
@import (reference) '../../customize/src/less2/include/messenger.less';
@import (reference) '../../customize/src/less2/include/avatar.less';
@import (reference) '../../customize/src/less2/include/buttons.less';
// body
&.cp-app-contacts {
@ -19,9 +18,6 @@
display: flex; // We need this to remove a 3px border at the bottom of the toolbar
}
.cp-app-contacts-friends {
.buttons_main();
}
.cp-contacts-muted-table {
.avatar_main(50px);
.cp-contacts-muted-user {
@ -33,8 +29,6 @@
}
}
.messenger_main();
}

@ -3,7 +3,6 @@
@import (reference) "../../customize/src/less2/include/tools.less";
@import (reference) "../../customize/src/less2/include/markdown.less";
@import (reference) "../../customize/src/less2/include/avatar.less";
@import (reference) "../../customize/src/less2/include/buttons.less";
// body
&.cp-app-kanban {
@ -142,6 +141,8 @@
.kanban-edit-item {
padding: 5px;
border: 0;
background: transparent;
align-self: flex-start;
}
@ -310,7 +311,6 @@
position: relative;
min-height: 50px;
.cp-kanban-filterTags {
.buttons_main();
display: inline-flex;
align-items: center;
flex: 1;
@ -346,7 +346,7 @@
margin-left: 10px;
display: flex;
flex-wrap: wrap;
&:not(:empty) {
&:not(.cp-empty) {
margin-top: -5px;
}
em {

@ -503,7 +503,7 @@ define([
$container.find('.kanban-item').each(function (i, el) {
var itemId = $(el).attr('data-eid');
$('<button>', {
'class': 'kanban-edit-item btn btn-default fa fa-pencil',
'class': 'kanban-edit-item fa fa-pencil',
'alt': Messages.kanban_editCard,
}).click(function (e) {
getItemEditModal(framework, kanban, itemId);
@ -513,7 +513,7 @@ define([
$container.find('.kanban-board').each(function (i, el) {
var itemId = $(el).attr('data-id');
$('<button>', {
'class': 'kanban-edit-item btn btn-default fa fa-pencil',
'class': 'kanban-edit-item fa fa-pencil',
'alt': Messages.kanban_editBoard,
}).click(function (e) {
getBoardEditModal(framework, kanban, itemId);
@ -913,7 +913,9 @@ define([
var redrawList = function (allTags) {
if (!Array.isArray(allTags)) { return; }
$list.empty();
$list.removeClass('cp-empty');
if (!allTags.length) {
$list.addClass('cp-empty');
$list.append(h('em', Messages.kanban_noTags));
return;
}

@ -1,6 +1,5 @@
@import (reference) "../../customize/src/less2/include/framework.less";
@import (reference) "../../customize/src/less2/include/comments.less";
@import (reference) "../../customize/src/less2/include/buttons.less";
body.cp-app-pad {
.framework_main(
@ -71,7 +70,6 @@ body.cp-app-pad {
order: 1;
}
div.cp-comment-bubble {
.buttons_main();
position: relative;
order: 2;
button {

@ -115,8 +115,11 @@ define([
}, {
ok: Messages.register_writtenPassword,
cancel: Messages.register_cancel,
cancelClass: 'safe',
okClass: 'danger',
/* If we're certain that we aren't using these "*Class" APIs
anywhere else then we can deprecate them and make this a
custom modal in common-interface (or here). */
cancelClass: 'btn.btn-safe',
okClass: 'btn.btn-danger',
reverseOrder: true,
done: function ($dialog) {
$dialog.find('> div').addClass('half');

@ -8,6 +8,7 @@
@import (reference) '../../customize/src/less2/include/password-input.less';
@import (reference) '../../customize/src/less2/include/modals-ui-elements.less';
@import (reference) '../../customize/src/less2/include/usergrid.less';
@import (reference) '../../customize/src/less2/include/forms.less';
&.cp-app-secureiframe {
.modals-ui-elements_main();
@ -19,6 +20,7 @@
.password_main();
.modal_main();
.usergrid_main();
.forms_main();
#cp-filepicker-dialog {
display: none;

@ -494,8 +494,8 @@ define([
}, {
ok: Messages.register_writtenPassword,
cancel: Messages.register_cancel,
cancelClass: 'safe',
okClass: 'danger',
cancelClass: 'btn.btn-safe',
okClass: 'btn.btn-danger',
reverseOrder: true,
done: function($dialog) {
$dialog.find('> div').addClass('half');

@ -66,11 +66,20 @@ define([
var $cat = $form.find('.cp-support-form-category');
var $title = $form.find('.cp-support-form-title');
var $content = $form.find('.cp-support-form-msg');
// XXX block submission until pending uploads are complete?
// TODO block submission until pending uploads are complete?
var $attachments = $form.find('.cp-support-attachments');
var category = $cat.val().trim();
/*
// || ($form.closest('.cp-support-list-ticket').data('cat') || "").trim();
// Messages.support_formCategoryError = "Error: category is empty"; // TODO ensure this is translated before use
if (!category) {
console.log($cat);
return void UI.alert(Messages.support_formCategoryError);
}
*/
var category = $cat.val().trim(); // XXX make category a required field?
var title = $title.val().trim();
if (!title) {
return void UI.alert(Messages.support_formTitleError);
@ -103,15 +112,6 @@ define([
return true;
};
Messages.support_cat_account = "User account"; // XXX
Messages.support_cat_data = "Loss of content"; // XXX
Messages.support_cat_bug = "Bug report"; // XXX
Messages.support_cat_other = "Other"; // XXX
Messages.support_cat_all = "All"; // XXX
Messages.support_category = "Category"; // XXX
Messages.support_attachments = "Attachments"; // XXX
Messages.support_addAttachment = "Add attachment"; // XXX
var makeCategoryDropdown = function (ctx, container, onChange, all) {
var categories = ['account', 'data', 'bug', 'other'];
if (all) { categories.push('all'); }
@ -126,11 +126,14 @@ Messages.support_addAttachment = "Add attachment"; // XXX
});
var dropdownCfg = {
text: Messages.support_category,
angleDown: 1,
options: categories,
container: $(container),
isSelect: true
};
return UIElements.createDropdown(dropdownCfg);
var $select = UIElements.createDropdown(dropdownCfg);
$select.find('button').addClass('btn');
return $select;
};
var makeForm = function (ctx, cb, title) {
@ -158,6 +161,7 @@ Messages.support_addAttachment = "Add attachment"; // XXX
h('hr'),
category,
catContainer,
h('br'),
h('input.cp-support-form-title' + (title ? '.cp-hidden' : ''), {
placeholder: Messages.support_formTitle,
type: 'text',
@ -169,7 +173,7 @@ Messages.support_addAttachment = "Add attachment"; // XXX
}),
h('label', Messages.support_attachments),
attachments = h('div.cp-support-attachments'),
addAttachment = h('button', Messages.support_addAttachment),
addAttachment = h('button.btn', Messages.support_addAttachment),
h('hr'),
button,
cancel
@ -184,8 +188,6 @@ Messages.support_addAttachment = "Add attachment"; // XXX
}).on('change', function (e) {
var files = Util.slice(e.target.files);
files.forEach(function (file) {
// XXX validate that the href is hosted on the same instance
// use relative URLs or compare it against a list or allowed domains?
var ev = {};
ev.callback = function (data) {
var x, a;
@ -326,10 +328,11 @@ Messages.support_addAttachment = "Add attachment"; // XXX
var attachments = (content.attachments || []).map(function (obj) {
if (!obj || !obj.name || !obj.href) { return; }
// only support files explicitly beginning with /file/ so that users can't link outside of the instance
if (!/^\/file\//.test(obj.href)) { return; }
var a = h('a', {
href: '#'
}, obj.name);
// XXX disallow remote URLs
$(a).click(function (e) {
e.preventDefault();
ctx.common.openURL(obj.href);

@ -45,7 +45,7 @@
.cp-app-contacts-input {
textarea {
border: 0px;
color: white;
color: @cryptpad_text_col;
}
}
}

@ -418,6 +418,10 @@ define([
]));
common.displayAvatar($(avatar), team.metadata.avatar, team.metadata.name);
$(btn).click(function () {
if (team.error) {
UI.warn(Messages.error); // XXX better error message - roster bug, can't load the team for now
return;
}
openTeam(common, id, team);
});
});

@ -1,6 +1,5 @@
@import (reference) '../../customize/src/less2/include/tools.less';
@import (reference) "../../customize/src/less2/include/framework.less";
@import (reference) "../../customize/src/less2/include/buttons.less";
&.cp-app-whiteboard {
@ -74,8 +73,6 @@
padding: 10px;
.buttons_main();
& > * + * {
margin: 0;
margin-left: 1em;

Loading…
Cancel
Save