diff --git a/src/effect.ts b/src/effect.ts
index 55eff346..02d0d20b 100644
--- a/src/effect.ts
+++ b/src/effect.ts
@@ -2,12 +2,15 @@ import { IHandlersParams, ITemplateParams } from "./helpers/interfaces";
export class UpploadEffect {
type = "effect";
- name: string = "";
+ name = "";
invisible = false;
noRecolor = false;
color = "#000";
- icon: string = "";
+ icon = "";
template: (props: ITemplateParams) => string = () => "";
- handlers: (params: IHandlersParams) => void = () => {};
+ /** Base handler method - meant to be overridden by subclasses */
+ handlers: (params: IHandlersParams) => void = () => {
+ // Intentionally empty - base implementation
+ };
supports: () => boolean = () => true;
}
diff --git a/src/effects/flip/index.ts b/src/effects/flip/index.ts
index c64c1c02..811afbae 100644
--- a/src/effects/flip/index.ts
+++ b/src/effects/flip/index.ts
@@ -75,7 +75,7 @@ export default class Flip extends UpploadEffect {
if (!img) return;
this.imageToCanvasBlob(params, x, y).then(blob => {
if (!blob) return;
- let file = this.originalFile;
+ const file = this.originalFile;
file.blob = blob;
params.next(file);
const image = URL.createObjectURL(blob);
diff --git a/src/helpers/i18n.ts b/src/helpers/i18n.ts
index 6ae8252e..31b5ebf8 100644
--- a/src/helpers/i18n.ts
+++ b/src/helpers/i18n.ts
@@ -3,11 +3,11 @@ let i18n: any = {};
export const flattenObject = (ob: any) => {
const toReturn: any = {};
for (const i in ob) {
- if (!ob.hasOwnProperty(i)) continue;
+ if (!Object.prototype.hasOwnProperty.call(ob, i)) continue;
if (typeof ob[i] == "object") {
const flatObject = flattenObject(ob[i]);
for (const x in flatObject) {
- if (!flatObject.hasOwnProperty(x)) continue;
+ if (!Object.prototype.hasOwnProperty.call(flatObject, x)) continue;
toReturn[i + "." + x] = flatObject[x];
}
} else {
diff --git a/src/helpers/utils.ts b/src/helpers/utils.ts
index 26af56a9..8280b699 100644
--- a/src/helpers/utils.ts
+++ b/src/helpers/utils.ts
@@ -12,11 +12,11 @@ export const minifyHTML = (html: string) =>
* @param decimals - The number of decimals to show
* @returns The formatted string
*/
-export const formatBytes = (bytes: number, decimals: number = 2) => {
+export const formatBytes = (bytes: number, decimals = 2) => {
if (bytes === 0) {
return "0 Bytes";
}
- const base: number = 1024;
+ const base = 1024;
const dm: number = decimals < 0 ? 0 : decimals;
const sizes: string[] = [
"Bytes",
diff --git a/src/i18n/fa.ts b/src/i18n/fa.ts
index c99e8fa4..3b86ad31 100644
--- a/src/i18n/fa.ts
+++ b/src/i18n/fa.ts
@@ -1,188 +1,189 @@
export const fa = {
- upload: "آپلود",
- cancel: "لغو",
- close: "بستن",
- uploading: "در حال بارگذاری...",
- uploaded: "آپلود شد",
- fetching: "در حال دریافت تصویر شما $1$...",
- poweredBy: "پشتیبانی شده توسط $1$",
- needHelp: "نیاز به کمک دارید؟",
+ upload: "آپلود",
+ cancel: "لغو",
+ close: "بستن",
+ uploading: "در حال بارگذاری...",
+ uploaded: "آپلود شد",
+ fetching: "در حال دریافت تصویر شما $1$...",
+ poweredBy: "پشتیبانی شده توسط $1$",
+ needHelp: "نیاز به کمک دارید؟",
- units: {
- px: "px",
- "%": "%",
- deg: "°",
- },
+ units: {
+ px: "px",
+ "%": "%",
+ deg: "°",
+ },
- errors: {
- response_not_ok: "در دریافت این فایل با خطا مواجه شدیم",
- unable_to_search: "در جستجو با خطا مواجه شدیم",
- invalid_service_url: "لینک $1$ نشانی اینترنتی نیست",
- invalid_url: "به نظر می رسد این نشانی اینترنتی نامعتبر است",
- upload_aborted: "آپلود شما لغو شد",
- upload_error: "هنگام آپلود این فایل با خطا مواجه شدیم",
- file_type_not_allowed: "این نوع فایل مجاز نیست",
- file_too_large: "فایل شما باید کوچکتر از $1$ باشد",
- },
+ errors: {
+ response_not_ok: "در دریافت این فایل با خطا مواجه شدیم",
+ unable_to_search: "در جستجو با خطا مواجه شدیم",
+ invalid_service_url: "لینک $1$ نشانی اینترنتی نیست",
+ invalid_url: "به نظر می رسد این نشانی اینترنتی نامعتبر است",
+ upload_aborted: "آپلود شما لغو شد",
+ upload_error: "هنگام آپلود این فایل با خطا مواجه شدیم",
+ file_type_not_allowed: "این نوع فایل مجاز نیست",
+ file_too_large: "فایل شما باید کوچکتر از $1$ باشد",
+ },
- help: {
- loading: "در حال بارگذاری راهنما...",
- close: "بستن راهنما",
- },
+ help: {
+ loading: "در حال بارگذاری راهنما...",
+ close: "بستن راهنما",
+ },
- services: {
- default: {
- heading: "یک تصویر را انتخاب کنید",
- },
- local: {
- title: "انتخاب فایل",
- button: "یک فایل را انتخاب کنید",
- or: "یا",
- drop: "فایلها را اینجا رها کنید",
- },
- camera: {
- title: "دوربین",
- button: "روی عکس کلیک کنید",
- switch: "تغییر دوربین",
- waiting: "منتظر اجازه...",
- unableToRead: "ما دسترسی به دوربین شما را نداریم. این ممکن است به این دلیل باشد که مجوز لازم را ندادهاید یا اینکه دوربین شما توسط برنامه دیگری در حال استفاده است.",
- },
- microlink: {
- button: "اضافه کردن از $1$",
- label: "$1$ $2$ لینک",
- placeholder: "لینک $1$ $2$ را وارد کنید",
- type: "ارسال",
- },
- url: {
- title: "لینک مستقیم",
- label: "لینک عکس",
- placeholder: "لینک عکس را وارد کنید",
- },
- instagram: {
- title: "Instagram",
- },
- facebook: {
- title: "Facebook",
- },
- flickr: {
- title: "Flickr",
- type: "photo",
- },
- ninegag: {
- title: "9GAG",
- type: "photo",
- },
- deviantart: {
- title: "DeviantArt",
- },
- artstation: {
- title: "ArtStation",
- },
- twitter: {
- title: "Twitter",
- type: "image tweet",
- },
- pinterest: {
- title: "Pinterest",
- type: "pin",
- },
- flipboard: {
- title: "Flipboard",
- type: "article",
- },
- fotki: {
- title: "Fotki",
- type: "photo",
- },
- linkedin: {
- title: "LinkedIn",
- },
- reddit: {
- title: "Reddit",
- },
- tumblr: {
- title: "Tumblr",
- },
- weheartit: {
- title: "We Heart It",
- },
- screenshot: {
- title: "اسکرینشات",
- button: "گرفتن اسکرینشات",
- label: "آدرس صفحهی اینترنتی",
- placeholder: "آدرس صفحهی اینترنتی را وارد کنید",
- loading: "در حال گرفتن اسکرینشات...",
- },
- search: {
- button: "جستجو در $1$",
- label: "جستجوی عکس",
- placeholder: "جستجو برای چیزی",
- imagesPoweredBy: "تصاویر پشتیبانی شده توسط $1$",
- },
- giphy: {
- title: "GIPHY",
- },
- unsplash: {
- title: "Unsplash",
- },
- pixabay: {
- title: "Pixabay",
- },
- pexels: {
- title: "Pexels",
- },
+ services: {
+ default: {
+ heading: "یک تصویر را انتخاب کنید",
+ },
+ local: {
+ title: "انتخاب فایل",
+ button: "یک فایل را انتخاب کنید",
+ or: "یا",
+ drop: "فایلها را اینجا رها کنید",
+ },
+ camera: {
+ title: "دوربین",
+ button: "روی عکس کلیک کنید",
+ switch: "تغییر دوربین",
+ waiting: "منتظر اجازه...",
+ unableToRead:
+ "ما دسترسی به دوربین شما را نداریم. این ممکن است به این دلیل باشد که مجوز لازم را ندادهاید یا اینکه دوربین شما توسط برنامه دیگری در حال استفاده است.",
+ },
+ microlink: {
+ button: "اضافه کردن از $1$",
+ label: "$1$ $2$ لینک",
+ placeholder: "لینک $1$ $2$ را وارد کنید",
+ type: "ارسال",
+ },
+ url: {
+ title: "لینک مستقیم",
+ label: "لینک عکس",
+ placeholder: "لینک عکس را وارد کنید",
+ },
+ instagram: {
+ title: "Instagram",
+ },
+ facebook: {
+ title: "Facebook",
+ },
+ flickr: {
+ title: "Flickr",
+ type: "photo",
+ },
+ ninegag: {
+ title: "9GAG",
+ type: "photo",
+ },
+ deviantart: {
+ title: "DeviantArt",
+ },
+ artstation: {
+ title: "ArtStation",
+ },
+ twitter: {
+ title: "Twitter",
+ type: "image tweet",
+ },
+ pinterest: {
+ title: "Pinterest",
+ type: "pin",
+ },
+ flipboard: {
+ title: "Flipboard",
+ type: "article",
+ },
+ fotki: {
+ title: "Fotki",
+ type: "photo",
+ },
+ linkedin: {
+ title: "LinkedIn",
+ },
+ reddit: {
+ title: "Reddit",
+ },
+ tumblr: {
+ title: "Tumblr",
},
+ weheartit: {
+ title: "We Heart It",
+ },
+ screenshot: {
+ title: "اسکرینشات",
+ button: "گرفتن اسکرینشات",
+ label: "آدرس صفحهی اینترنتی",
+ placeholder: "آدرس صفحهی اینترنتی را وارد کنید",
+ loading: "در حال گرفتن اسکرینشات...",
+ },
+ search: {
+ button: "جستجو در $1$",
+ label: "جستجوی عکس",
+ placeholder: "جستجو برای چیزی",
+ imagesPoweredBy: "تصاویر پشتیبانی شده توسط $1$",
+ },
+ giphy: {
+ title: "GIPHY",
+ },
+ unsplash: {
+ title: "Unsplash",
+ },
+ pixabay: {
+ title: "Pixabay",
+ },
+ pexels: {
+ title: "Pexels",
+ },
+ },
- effects: {
- preview: {
- title: "پیشنمایش",
- },
- filters: {
- title: "فیلترها",
- },
- crop: {
- title: "برش",
- aspectRatios: {
- free: "آزاد",
- square: "مربع",
- },
- },
- rotate: {
- title: "چرخش",
- },
- flip: {
- title: "برگرداندن",
- buttons: {
- horizontal: "افقی",
- vertical: "عمودی",
- },
- },
- sharpen: {
- title: "تیز کردن",
- },
- blur: {
- title: "بلور",
- },
- brightness: {
- title: "روشنایی",
- },
- contrast: {
- title: "کنتراست",
- },
- grayscale: {
- title: "سیاهسفید",
- },
- "hue-rotate": {
- title: "چرخش رنگ",
- },
- invert: {
- title: "معکوس کردن",
- },
- saturate: {
- title: "تشبیه",
- },
- sepia: {
- title: "سپیا",
- },
+ effects: {
+ preview: {
+ title: "پیشنمایش",
+ },
+ filters: {
+ title: "فیلترها",
+ },
+ crop: {
+ title: "برش",
+ aspectRatios: {
+ free: "آزاد",
+ square: "مربع",
+ },
+ },
+ rotate: {
+ title: "چرخش",
+ },
+ flip: {
+ title: "برگرداندن",
+ buttons: {
+ horizontal: "افقی",
+ vertical: "عمودی",
+ },
+ },
+ sharpen: {
+ title: "تیز کردن",
+ },
+ blur: {
+ title: "بلور",
+ },
+ brightness: {
+ title: "روشنایی",
+ },
+ contrast: {
+ title: "کنتراست",
+ },
+ grayscale: {
+ title: "سیاهسفید",
+ },
+ "hue-rotate": {
+ title: "چرخش رنگ",
+ },
+ invert: {
+ title: "معکوس کردن",
+ },
+ saturate: {
+ title: "تشبیه",
+ },
+ sepia: {
+ title: "سپیا",
},
+ },
};
diff --git a/src/service.ts b/src/service.ts
index ae178538..01a1bb89 100644
--- a/src/service.ts
+++ b/src/service.ts
@@ -2,13 +2,19 @@ import { IHandlersParams, IServiceTemplateParams } from "./helpers/interfaces";
export class UpploadService {
type = "service";
- name: string = "";
+ name = "";
invisible = false;
noRecolor = false;
- icon: string = "";
+ icon = "";
color = "#333";
template: (params: IServiceTemplateParams) => string = () => "";
- handlers: (params: IHandlersParams) => void = () => {};
- stop: () => void = () => {};
+ /** Base handler method - meant to be overridden by subclasses */
+ handlers: (params: IHandlersParams) => void = () => {
+ // Intentionally empty - base implementation
+ };
+ /** Base stop method - meant to be overridden by subclasses */
+ stop: () => void = () => {
+ // Intentionally empty - base implementation
+ };
supports: () => boolean = () => true;
}
diff --git a/src/services/local.ts b/src/services/local.ts
index c9928633..1d8ddefd 100644
--- a/src/services/local.ts
+++ b/src/services/local.ts
@@ -9,7 +9,7 @@ export default class Local extends UpploadService {
icon = ``;
color = "#34495e";
mimeTypes = ["image/gif", "image/jpeg", "image/jpg", "image/png"];
- maxFileSize: number = Infinity;
+ maxFileSize = Infinity;
constructor({
mimeTypes,
diff --git a/src/services/microlink/9gag.ts b/src/services/microlink/9gag.ts
index be91892b..1ec0ef7a 100644
--- a/src/services/microlink/9gag.ts
+++ b/src/services/microlink/9gag.ts
@@ -6,7 +6,7 @@ export default class NineGag extends MicrolinkBaseClass {
color = "#000";
exampleURL = "https://9gag.com/gag/awoBXb8";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?9gag\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?9gag\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/artstation.ts b/src/services/microlink/artstation.ts
index a92d2a05..05507afb 100644
--- a/src/services/microlink/artstation.ts
+++ b/src/services/microlink/artstation.ts
@@ -6,7 +6,7 @@ export default class ArtStation extends MicrolinkBaseClass {
color = "#3ea2cf";
exampleURL = "https://www.artstation.com/artwork/VdGOkZ";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?artstation\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?artstation\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/deviantart.ts b/src/services/microlink/deviantart.ts
index 50db4f82..93df1d8e 100644
--- a/src/services/microlink/deviantart.ts
+++ b/src/services/microlink/deviantart.ts
@@ -7,7 +7,7 @@ export default class DeviantArt extends MicrolinkBaseClass {
exampleURL =
"https://www.deviantart.com/artbycatherineradley/art/Despair-820869682";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(deviantart|fav)\.(com|me)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?(deviantart|fav)\.(com|me)(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/facebook.ts b/src/services/microlink/facebook.ts
index fc61af11..c73890d3 100644
--- a/src/services/microlink/facebook.ts
+++ b/src/services/microlink/facebook.ts
@@ -7,7 +7,7 @@ export default class Facebook extends MicrolinkBaseClass {
exampleURL =
"https://www.facebook.com/elninotech/photos/a.2066268863489861/2066268886823192/?type=3&theater";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(facebook|fb)\.(com|me)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?(facebook|fb)\.(com|me)(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/flickr.ts b/src/services/microlink/flickr.ts
index 9ef3f537..2d72a5e3 100644
--- a/src/services/microlink/flickr.ts
+++ b/src/services/microlink/flickr.ts
@@ -7,7 +7,7 @@ export default class Flickr extends MicrolinkBaseClass {
color = "#ff0084";
exampleURL = "https://www.flickr.com/photos/renewolf/26111951000/";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(flickr|flic)\.(com|kr)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?(flickr|flic)\.(com|kr)(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/flipboard.ts b/src/services/microlink/flipboard.ts
index 32a5afb4..229ecb52 100644
--- a/src/services/microlink/flipboard.ts
+++ b/src/services/microlink/flipboard.ts
@@ -7,7 +7,7 @@ export default class Flipboard extends MicrolinkBaseClass {
exampleURL =
"https://flipboard.com/@bbcfuture/how-climate-change-could-kill-the-red-apple/f-c8d499b4ca%2Fbbc.com";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(flipboard|flip)\.(com|it)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?(flipboard|flip)\.(com|it)(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/fotki.ts b/src/services/microlink/fotki.ts
index 53aa4364..45d5d868 100644
--- a/src/services/microlink/fotki.ts
+++ b/src/services/microlink/fotki.ts
@@ -7,7 +7,7 @@ export default class Fotki extends MicrolinkBaseClass {
exampleURL =
"https://public.fotki.com/EricAnke/holland/molens/20170928-162510.html";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?fotki\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?fotki\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/instagram.ts b/src/services/microlink/instagram.ts
index 8a62d05a..039039d5 100644
--- a/src/services/microlink/instagram.ts
+++ b/src/services/microlink/instagram.ts
@@ -6,7 +6,7 @@ export default class Instagram extends MicrolinkBaseClass {
color = "#cc3366";
exampleURL = "https://www.instagram.com/p/Bu_T4RihQFB/";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(instagram|instagr)\.(com|am)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?(instagram|instagr)\.(com|am)(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/linkedin.ts b/src/services/microlink/linkedin.ts
index 26a0ca0b..416fe16e 100644
--- a/src/services/microlink/linkedin.ts
+++ b/src/services/microlink/linkedin.ts
@@ -2,12 +2,11 @@ import { MicrolinkBaseClass } from "../../helpers/microlink";
export default class LinkedIn extends MicrolinkBaseClass {
name = "linkedin";
- icon = ``;
- color = "#0e76a8";
- exampleURL =
- "https://www.linkedin.com/posts/explorius-vastgoedontwikkeling-b-v-_el-nino-huurt-kantoor-in-enschede-activity-6480386878641180672-7DC_";
+ icon = ``;
+ color = "#1082c7";
+ exampleURL = "https://www.linkedin.com/in/anandchowdhary/";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?linkedin\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?linkedin\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/pinterest.ts b/src/services/microlink/pinterest.ts
index 54529552..c61248fe 100644
--- a/src/services/microlink/pinterest.ts
+++ b/src/services/microlink/pinterest.ts
@@ -2,11 +2,11 @@ import { MicrolinkBaseClass } from "../../helpers/microlink";
export default class Pinterest extends MicrolinkBaseClass {
name = "pinterest";
- icon = ``;
- color = "#e60023";
- exampleURL = "https://pinterest.com/pin/437201076327078006/";
+ icon = ``;
+ color = "#e12828";
+ exampleURL = "https://www.pinterest.com/pin/526147168097149894/";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(pinterest|pin)\.(com|it)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?pinterest\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/reddit.ts b/src/services/microlink/reddit.ts
index f99aa297..77c87461 100644
--- a/src/services/microlink/reddit.ts
+++ b/src/services/microlink/reddit.ts
@@ -2,12 +2,12 @@ import { MicrolinkBaseClass } from "../../helpers/microlink";
export default class Reddit extends MicrolinkBaseClass {
name = "reddit";
- icon = ``;
- color = "#ff4301";
+ icon = ``;
+ color = "#ff4500";
exampleURL =
- "https://www.reddit.com/r/thenetherlands/comments/dz1myk/a_beautiful_morning_in_ermelo/";
+ "https://www.reddit.com/r/elonmusk/comments/96oy63/elons_new_profile_picture/";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?reddit\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?reddit\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/tumblr.ts b/src/services/microlink/tumblr.ts
index 8638a0d1..5f2b0cf1 100644
--- a/src/services/microlink/tumblr.ts
+++ b/src/services/microlink/tumblr.ts
@@ -2,12 +2,12 @@ import { MicrolinkBaseClass } from "../../helpers/microlink";
export default class Tumblr extends MicrolinkBaseClass {
name = "tumblr";
- icon = ``;
- color = "#34526f";
+ icon = ``;
+ color = "#35465c";
exampleURL =
- "https://germanpostwarmodern.tumblr.com/post/186653088149/cubicus-building-of-twente-university-1969-73-in";
+ "https://explorius.tumblr.com/post/182508847649/thank-you-to-a-fantastic-2018-and-hello-to-a";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?tumblr\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?tumblr\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/twitter.ts b/src/services/microlink/twitter.ts
index 8a884710..e4efe74a 100644
--- a/src/services/microlink/twitter.ts
+++ b/src/services/microlink/twitter.ts
@@ -2,11 +2,11 @@ import { MicrolinkBaseClass } from "../../helpers/microlink";
export default class Twitter extends MicrolinkBaseClass {
name = "twitter";
- icon = ``;
+ icon = ``;
color = "#1da1f2";
- exampleURL = "https://twitter.com/elninoict/status/1106176415622418433";
+ exampleURL = "https://twitter.com/AnandChowdhary/status/1130815388839460864";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?(twitter|t)\.(co|com)(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?(twitter|t)\.(com|co)(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/services/microlink/weheartit.ts b/src/services/microlink/weheartit.ts
index 812ef2cc..165dd862 100644
--- a/src/services/microlink/weheartit.ts
+++ b/src/services/microlink/weheartit.ts
@@ -2,11 +2,11 @@ import { MicrolinkBaseClass } from "../../helpers/microlink";
export default class WeHeartIt extends MicrolinkBaseClass {
name = "weheartit";
- icon = ``;
- color = "#ff5464";
- exampleURL = "https://weheartit.com/entry/221671573";
+ icon = ``;
+ color = "#ff6771";
+ exampleURL = "https://weheartit.com/entry/321668842";
validator = (input: string) =>
- /(https?:\/\/(.+?\.)?weheartit\.com(\/[A-Za-z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;\=]*)?)/.test(
+ /(https?:\/\/(.+?\.)?weheartit\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
input
);
}
diff --git a/src/uppload.ts b/src/uppload.ts
index 5cb49e89..c5bc8880 100644
--- a/src/uppload.ts
+++ b/src/uppload.ts
@@ -228,7 +228,7 @@ export class Uppload implements IUppload {
this.container.style.transition = `${this.transitionDuration}ms`;
this.container.style.opacity = "0";
this.update();
- let firstService = this.settings.defaultService;
+ const firstService = this.settings.defaultService;
if (this.services.length === 3) this.navigate(this.services[2].name);
if (firstService) this.navigate(firstService);
safeListen(document.body, "keyup", e => {
diff --git a/tests/services/local.test.ts b/tests/services/local.test.ts
index cd5193e6..6cec1bfc 100644
--- a/tests/services/local.test.ts
+++ b/tests/services/local.test.ts
@@ -36,13 +36,13 @@ const fakeEvent = {
};
test("drop handler", () => {
- let file = null;
+ const file = null;
service.dropHandler(handlersParams, fakeEvent as any);
expect(file).toBeDefined();
});
test("get file", () => {
- let file = null;
+ const file = null;
service.getFile(handlersParams, fakeEvent as any);
expect(file).toBeDefined();
});