minor cleanup

This commit is contained in:
or-else
2021-07-15 18:51:56 -07:00
parent 0afef6c587
commit 0cd432a52f
10 changed files with 66 additions and 38 deletions
+3 -2
View File
@@ -1117,8 +1117,8 @@ i.search {
color: #666; color: #666;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 8rem;
height: 100%; height: 8rem;
justify-content: center; justify-content: center;
background: center no-repeat url("../img/broken_image.png"); background: center no-repeat url("../img/broken_image.png");
border-radius: 50%; border-radius: 50%;
@@ -1147,6 +1147,7 @@ i.search {
margin-top: -1rem; margin-top: -1rem;
bottom: 0; bottom: 0;
background-color: #fafafa; background-color: #fafafa;
z-index: 1;
} }
.avatar-upload .inputfile:focus + label.round { .avatar-upload .inputfile:focus + label.round {
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -3
View File
@@ -147,7 +147,6 @@ export function imageCrop(mime, objURL, left, top, width, height, scale, onSucce
canvas.height = height * scale; canvas.height = height * scale;
let ctx = canvas.getContext('2d'); let ctx = canvas.getContext('2d');
ctx.imageSmoothingEnabled = true; ctx.imageSmoothingEnabled = true;
console.log("drawImage from", left, top, width, height, "to", canvas.width, canvas.height);
ctx.drawImage(this, left, top, width, height, 0, 0, canvas.width, canvas.height); ctx.drawImage(this, left, top, width, height, 0, 0, canvas.width, canvas.height);
mime = SUPPORTED_IMAGE_FORMATS.includes(mime) ? mime : 'image/jpeg'; mime = SUPPORTED_IMAGE_FORMATS.includes(mime) ? mime : 'image/jpeg';
@@ -191,7 +190,7 @@ export function filePasted(event, onImageSuccess, onAttachmentSuccess, onError)
if (item.kind === 'file') { if (item.kind === 'file') {
var file = item.getAsFile(); var file = item.getAsFile();
if (!file) { if (!file) {
console.log("Failed to get file object from pasted file item", item.kind, item.type); console.error("Failed to get file object from pasted file item", item.kind, item.type);
continue; continue;
} }
if (file.type && file.type.split('/')[0] == 'image') { if (file.type && file.type.split('/')[0] == 'image') {
@@ -239,7 +238,7 @@ export function base64ReEncode(str) {
try { try {
str = btoa(atob(str)); str = btoa(atob(str));
} catch(err) { } catch(err) {
console.log("Failed to base64 re-encode string.", err); console.error("Failed to base64 re-encode string.", err);
str = null; str = null;
} }
} }
-2
View File
@@ -118,8 +118,6 @@ class SidepanelView extends React.Component {
badges = null; badges = null;
} }
console.log("avatar URL=", avatar);
let onCancel; let onCancel;
if (['login', 'contacts'].indexOf(view) == -1) { if (['login', 'contacts'].indexOf(view) == -1) {
onCancel = this.props.onCancel; onCancel = this.props.onCancel;
+2 -4
View File
@@ -234,7 +234,6 @@ function imageCrop(mime, objURL, left, top, width, height, scale, onSuccess, onE
canvas.height = height * scale; canvas.height = height * scale;
let ctx = canvas.getContext('2d'); let ctx = canvas.getContext('2d');
ctx.imageSmoothingEnabled = true; ctx.imageSmoothingEnabled = true;
console.log("drawImage from", left, top, width, height, "to", canvas.width, canvas.height);
ctx.drawImage(this, left, top, width, height, 0, 0, canvas.width, canvas.height); ctx.drawImage(this, left, top, width, height, 0, 0, canvas.width, canvas.height);
mime = SUPPORTED_IMAGE_FORMATS.includes(mime) ? mime : 'image/jpeg'; mime = SUPPORTED_IMAGE_FORMATS.includes(mime) ? mime : 'image/jpeg';
let blob = await new Promise(resolve => canvas.toBlob(resolve, mime)); let blob = await new Promise(resolve => canvas.toBlob(resolve, mime));
@@ -274,7 +273,7 @@ function filePasted(event, onImageSuccess, onAttachmentSuccess, onError) {
var file = item.getAsFile(); var file = item.getAsFile();
if (!file) { if (!file) {
console.log("Failed to get file object from pasted file item", item.kind, item.type); console.error("Failed to get file object from pasted file item", item.kind, item.type);
continue; continue;
} }
@@ -311,7 +310,7 @@ function base64ReEncode(str) {
try { try {
str = btoa(atob(str)); str = btoa(atob(str));
} catch (err) { } catch (err) {
console.log("Failed to base64 re-encode string.", err); console.error("Failed to base64 re-encode string.", err);
str = null; str = null;
} }
} }
@@ -4929,7 +4928,6 @@ class SidepanelView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compon
badges = null; badges = null;
} }
console.log("avatar URL=", avatar);
let onCancel; let onCancel;
if (['login', 'contacts'].indexOf(view) == -1) { if (['login', 'contacts'].indexOf(view) == -1) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+54 -22
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long