Enter Tracking Pixel URL
diff --git a/src/taskpane/taskpane.ts b/src/taskpane/taskpane.ts
index a5b9071..36f322a 100644
--- a/src/taskpane/taskpane.ts
+++ b/src/taskpane/taskpane.ts
@@ -117,6 +117,15 @@ Office.onReady((info) => {
insertLock = true;
insert();
};
+
+ let textItem = document.getElementById("tracking-pixel-url") as HTMLInputElement;
+ textItem.addEventListener("keyup", function (event) {
+ if (event.key === "Enter") {
+ event.preventDefault();
+ insertButton.click();
+ }
+ });
+
setInterval(loadTrackingPixels, 500);
setupInstructionDropdown();
@@ -129,6 +138,7 @@ export async function insert() {
const urlItem = document.getElementById("tracking-pixel-url") as HTMLInputElement;
urlItem.value = urlItem.value.trim();
let error = false;
+
if (!urlItem.value.match(/(https|http):\/\//)) {
Office.context.mailbox.item.notificationMessages.replaceAsync("notify", {
type: "informationalMessage",
diff --git a/webpack.config.js b/webpack.config.js
index 2f48f99..41c5fb2 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -14,7 +14,7 @@ async function getHttpsOptions() {
module.exports = async (env, options) => {
const dev = options.mode === "development";
- if (!env.urlProd) {
+ if (!env.urlProd && !dev) {
throw new Error("urlProd is required");
}