diff --git a/README.md b/README.md
index f9277ed..52a8cb0 100644
--- a/README.md
+++ b/README.md
@@ -2,29 +2,29 @@
Observe.js
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Observe.js%2C%20a%20free%20JavaScript%observe%builder&url=https://github.com/williamtroup/Observe.js&hashtags=javascript,html,observe)
-[![npm](https://img.shields.io/badge/npmjs-v1.0.1-blue)](https://www.npmjs.com/package/jobserve.js)
-[![nuget](https://img.shields.io/badge/nuget-v1.0.1-purple)](https://www.nuget.org/packages/jObserve.js/)
+[![npm](https://img.shields.io/badge/npmjs-v1.1.0-blue)](https://www.npmjs.com/package/jobserve.js)
+[![nuget](https://img.shields.io/badge/nuget-v1.1.0-purple)](https://www.nuget.org/packages/jObserve.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Observe.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Observe.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://www.william-troup.com/)
>
A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
->
v1.0.1
+>
v1.1.0
What features does Observe.js have?
-- Zero-dependencies and extremely lightweight!
-- Written in TypeScript, allowing greater support for React, Angular, and other libraries!
-- JS Object and HTML DOM Element watching!
-- Watch for specific property changes!
-- Cancel, Pause, and Resume support!
-- Full API available via public functions.
-- Fully configurable!
-- Fully configurable per watch!
-- Custom triggers for actions (when changes are detected, on cancellation, etc).
+- 😏 Zero-dependencies and extremely lightweight!
+- 🦾 Written in TypeScript, allowing greater support for React, Angular, and other libraries!
+- 💻 Full API available via public functions.
+- 🎥 JS Object and HTML DOM Element watching!
+- 🔍 Watch for specific property changes!
+- 🚀 Cancel, Pause, and Resume support!
+- ☑️ Fully configurable!
+- ☑️ Fully configurable per watch!
+- ❓ Custom triggers for actions (when changes are detected, on cancellation, etc).
diff --git a/README_NUGET.md b/README_NUGET.md
index b686156..677e5ce 100644
--- a/README_NUGET.md
+++ b/README_NUGET.md
@@ -1,8 +1,8 @@
-# Observe.js v1.0.1
+# Observe.js v1.1.0
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Observe.js%2C%20a%20free%20JavaScript%observe%builder&url=https://github.com/williamtroup/Observe.js&hashtags=javascript,html,observe)
-[![npm](https://img.shields.io/badge/npmjs-v1.0.1-blue)](https://www.npmjs.com/package/jobserve.js)
-[![nuget](https://img.shields.io/badge/nuget-v1.0.1-purple)](https://www.nuget.org/packages/jObserve.js/)
+[![npm](https://img.shields.io/badge/npmjs-v1.1.0-blue)](https://www.npmjs.com/package/jobserve.js)
+[![nuget](https://img.shields.io/badge/nuget-v1.1.0-purple)](https://www.nuget.org/packages/jObserve.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Observe.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Observe.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://www.william-troup.com/)
@@ -12,15 +12,15 @@
## What features does Observe.js have?
-- Zero-dependencies and extremely lightweight!
-- Written in TypeScript, allowing greater support for React, Angular, and other libraries!
-- JS Object and HTML DOM Element watching!
-- Watch for specific property changes!
-- Cancel, Pause, and Resume support!
-- Full API available via public functions.
-- Fully configurable!
-- Fully configurable per watch!
-- Custom triggers for actions (when changes are detected, on cancellation, etc).
+- 😏 Zero-dependencies and extremely lightweight!
+- 🦾 Written in TypeScript, allowing greater support for React, Angular, and other libraries!
+- 💻 Full API available via public functions.
+- 🎥 JS Object and HTML DOM Element watching!
+- 🔍 Watch for specific property changes!
+- 🚀 Cancel, Pause, and Resume support!
+- ☑️ Fully configurable!
+- ☑️ Fully configurable per watch!
+- ❓ Custom triggers for actions (when changes are detected, on cancellation, etc).
## What browsers are supported?
diff --git a/dist/observe.esm.js b/dist/observe.esm.js
index 52ebf9b..93a6819 100644
--- a/dist/observe.esm.js
+++ b/dist/observe.esm.js
@@ -1,623 +1,542 @@
-var __getOwnPropNames = Object.getOwnPropertyNames;
-
-var __esm = (e, t) => function n() {
- return e && (t = (0, e[__getOwnPropNames(e)[0]])(e = 0)), t;
-};
-
-var __commonJS = (e, t) => function n() {
- return t || (0, e[__getOwnPropNames(e)[0]])((t = {
- exports: {}
- }).exports, t), t.exports;
-};
-
var Constant;
-var init_constant = __esm({
- "src/ts/constant.ts"() {
- "use strict";
- (e => {
- e.OBSERVE_JS_ATTRIBUTE_NAME = "data-observe-js";
- })(Constant || (Constant = {}));
- }
-});
-
-var init_enum = __esm({
- "src/ts/data/enum.ts"() {
- "use strict";
- }
-});
+(e => {
+ e.OBSERVE_JS_ATTRIBUTE_NAME = "data-observe-js";
+})(Constant || (Constant = {}));
var Is;
-var init_is = __esm({
- "src/ts/data/is.ts"() {
- "use strict";
- init_enum();
- (e => {
- function t(e) {
- return e !== null && e !== void 0 && e.toString() !== "";
- }
- e.defined = t;
- function n(e) {
- return t(e) && typeof e === "object";
- }
- e.definedObject = n;
- function r(e) {
- return t(e) && typeof e === "boolean";
- }
- e.definedBoolean = r;
- function o(e) {
- return t(e) && typeof e === "string";
- }
- e.definedString = o;
- function i(e) {
- return t(e) && typeof e === "function";
- }
- e.definedFunction = i;
- function s(e) {
- return t(e) && typeof e === "number";
- }
- e.definedNumber = s;
- function a(e) {
- return n(e) && e instanceof Array;
- }
- e.definedArray = a;
- function c(e) {
- return n(e) && e instanceof Date;
- }
- e.definedDate = c;
- })(Is || (Is = {}));
+(e => {
+ function t(e) {
+ return e !== null && e !== void 0 && e.toString() !== "";
+ }
+ e.defined = t;
+ function n(e) {
+ return t(e) && typeof e === "object";
+ }
+ e.definedObject = n;
+ function r(e) {
+ return t(e) && typeof e === "boolean";
+ }
+ e.definedBoolean = r;
+ function o(e) {
+ return t(e) && typeof e === "string";
}
-});
+ e.definedString = o;
+ function i(e) {
+ return t(e) && typeof e === "function";
+ }
+ e.definedFunction = i;
+ function a(e) {
+ return t(e) && typeof e === "number";
+ }
+ e.definedNumber = a;
+ function s(e) {
+ return n(e) && e instanceof Array;
+ }
+ e.definedArray = s;
+ function u(e) {
+ return n(e) && e instanceof Date;
+ }
+ e.definedDate = u;
+})(Is || (Is = {}));
-var Str;
+var Log;
-var init_str = __esm({
- "src/ts/data/str.ts"() {
- "use strict";
- init_enum();
- (e => {
- function t() {
- const e = [];
- for (let t = 0; t < 32; t++) {
- if (t === 8 || t === 12 || t === 16 || t === 20) {
- e.push("-");
- }
- const n = Math.floor(Math.random() * 16).toString(16);
- e.push(n);
- }
- return e.join("");
- }
- e.newGuid = t;
- })(Str || (Str = {}));
+(e => {
+ function t(e, t) {
+ let n = true;
+ if (!t.safeMode) {
+ console.error(e);
+ n = false;
+ }
+ return n;
}
-});
+ e.error = t;
+})(Log || (Log = {}));
-var Default;
+var Default2;
-var init_default = __esm({
- "src/ts/data/default.ts"() {
- "use strict";
- init_enum();
- init_is();
- (e => {
- function t(e, t) {
- return typeof e === "string" ? e : t;
- }
- e.getAnyString = t;
- function n(e, t) {
- return Is.definedString(e) ? e : t;
- }
- e.getString = n;
- function r(e, t) {
- return Is.definedBoolean(e) ? e : t;
- }
- e.getBoolean = r;
- function o(e, t) {
- return Is.definedNumber(e) ? e : t;
- }
- e.getNumber = o;
- function i(e, t) {
- return Is.definedFunction(e) ? e : t;
- }
- e.getFunction = i;
- function s(e, t) {
- return Is.definedArray(e) ? e : t;
- }
- e.getArray = s;
- function a(e, t) {
- return Is.definedObject(e) ? e : t;
+(Default => {
+ function getAnyString(e, t) {
+ return typeof e === "string" ? e : t;
+ }
+ Default.getAnyString = getAnyString;
+ function getString(e, t) {
+ return Is.definedString(e) ? e : t;
+ }
+ Default.getString = getString;
+ function getBoolean(e, t) {
+ return Is.definedBoolean(e) ? e : t;
+ }
+ Default.getBoolean = getBoolean;
+ function getNumber(e, t) {
+ return Is.definedNumber(e) ? e : t;
+ }
+ Default.getNumber = getNumber;
+ function getFunction(e, t) {
+ return Is.definedFunction(e) ? e : t;
+ }
+ Default.getFunction = getFunction;
+ function getArray(e, t) {
+ return Is.definedArray(e) ? e : t;
+ }
+ Default.getArray = getArray;
+ function getObject(e, t) {
+ return Is.definedObject(e) ? e : t;
+ }
+ Default.getObject = getObject;
+ function getDate(e, t) {
+ return Is.definedDate(e) ? e : t;
+ }
+ Default.getDate = getDate;
+ function getStringOrArray(e, t) {
+ let n = t;
+ if (Is.definedString(e)) {
+ const r = e.toString().split("space");
+ if (r.length === 0) {
+ e = t;
+ } else {
+ n = r;
}
- e.getObject = a;
- function c(e, t) {
- return Is.definedDate(e) ? e : t;
+ } else {
+ n = getArray(e, t);
+ }
+ return n;
+ }
+ Default.getStringOrArray = getStringOrArray;
+ function getObjectFromString(objectString, configuration) {
+ const result = {
+ parsed: true,
+ object: null
+ };
+ try {
+ if (Is.definedString(objectString)) {
+ result.object = JSON.parse(objectString);
}
- e.getDate = c;
- function u(e, t) {
- let n = t;
- if (Is.definedString(e)) {
- const r = e.toString().split("space");
- if (r.length === 0) {
- e = t;
- } else {
- n = r;
- }
- } else {
- n = s(e, t);
+ } catch (e1) {
+ try {
+ result.object = eval(`(${objectString})`);
+ if (Is.definedFunction(result.object)) {
+ result.object = result.object();
+ configuration;
}
- return n;
+ } catch (e) {
+ if (!configuration.safeMode) {
+ Log.error(configuration.text.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message), configuration);
+ result.parsed = false;
+ }
+ result.object = null;
}
- e.getStringOrArray = u;
- })(Default || (Default = {}));
+ }
+ return result;
}
-});
+ Default.getObjectFromString = getObjectFromString;
+})(Default2 || (Default2 = {}));
var Config;
-var init_config = __esm({
- "src/ts/options/config.ts"() {
- "use strict";
- init_default();
- (e => {
- let t;
- (e => {
- function t(e = null) {
- let t = Default.getObject(e, {});
- t.safeMode = Default.getBoolean(t.safeMode, true);
- t.domElementTypes = Default.getStringOrArray(t.domElementTypes, [ "*" ]);
- t = n(t);
- return t;
- }
- e.get = t;
- function n(e) {
- e.text = Default.getObject(e.text, {});
- e.text.objectErrorText = Default.getString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
- e.text.attributeNotValidErrorText = Default.getString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
- e.text.attributeNotSetErrorText = Default.getString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
- return e;
- }
- })(t = e.Options || (e.Options = {}));
- })(Config || (Config = {}));
- }
-});
+(e => {
+ let t;
+ (e => {
+ function t(e = null) {
+ let t = Default2.getObject(e, {});
+ t.safeMode = Default2.getBoolean(t.safeMode, true);
+ t.domElementTypes = Default2.getStringOrArray(t.domElementTypes, [ "*" ]);
+ t = n(t);
+ return t;
+ }
+ e.get = t;
+ function n(e) {
+ e.text = Default2.getObject(e.text, {});
+ e.text.objectErrorText = Default2.getString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
+ e.text.attributeNotValidErrorText = Default2.getString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
+ e.text.attributeNotSetErrorText = Default2.getString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
+ return e;
+ }
+ })(t = e.Options || (e.Options = {}));
+})(Config || (Config = {}));
var Watch;
-var init_watch = __esm({
- "src/ts/options/watch.ts"() {
- "use strict";
- init_default();
- (e => {
- let t;
- (e => {
- function t(e) {
- let t = Default.getObject(e, {});
- t.timeout = Default.getNumber(t.timeout, 250);
- t.starts = Default.getDate(t.starts, null);
- t.expires = Default.getDate(t.expires, null);
- t.reset = Default.getBoolean(t.reset, false);
- t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false);
- t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0);
- t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0);
- t.propertyNames = Default.getArray(t.propertyNames, null);
- t.allowCanceling = Default.getBoolean(t.allowCanceling, true);
- t.allowPausing = Default.getBoolean(t.allowPausing, true);
- t.removeAttribute = Default.getBoolean(t.removeAttribute, true);
- t = n(t);
- return t;
- }
- e.get = t;
- function n(e) {
- e.events = Default.getObject(e.events, {});
- e.events.onChange = Default.getFunction(e.events.onChange, null);
- e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null);
- e.events.onCancel = Default.getFunction(e.events.onCancel, null);
- e.events.onRemove = Default.getFunction(e.events.onRemove, null);
- e.events.onStart = Default.getFunction(e.events.onStart, null);
- return e;
- }
- })(t = e.Options || (e.Options = {}));
- })(Watch || (Watch = {}));
- }
-});
+(e => {
+ let t;
+ (e => {
+ function t(e) {
+ let t = Default2.getObject(e, {});
+ t.timeout = Default2.getNumber(t.timeout, 250);
+ t.starts = Default2.getDate(t.starts, null);
+ t.expires = Default2.getDate(t.expires, null);
+ t.reset = Default2.getBoolean(t.reset, false);
+ t.cancelOnChange = Default2.getBoolean(t.cancelOnChange, false);
+ t.maximumChangesBeforeCanceling = Default2.getNumber(t.maximumChangesBeforeCanceling, 0);
+ t.pauseTimeoutOnChange = Default2.getNumber(t.pauseTimeoutOnChange, 0);
+ t.propertyNames = Default2.getArray(t.propertyNames, null);
+ t.allowCanceling = Default2.getBoolean(t.allowCanceling, true);
+ t.allowPausing = Default2.getBoolean(t.allowPausing, true);
+ t.removeAttribute = Default2.getBoolean(t.removeAttribute, true);
+ t = n(t);
+ return t;
+ }
+ e.get = t;
+ function n(e) {
+ e.events = Default2.getObject(e.events, {});
+ e.events.onChange = Default2.getFunction(e.events.onChange, null);
+ e.events.onPropertyChange = Default2.getFunction(e.events.onPropertyChange, null);
+ e.events.onCancel = Default2.getFunction(e.events.onCancel, null);
+ e.events.onRemove = Default2.getFunction(e.events.onRemove, null);
+ e.events.onStart = Default2.getFunction(e.events.onStart, null);
+ return e;
+ }
+ })(t = e.Options || (e.Options = {}));
+})(Watch || (Watch = {}));
var Trigger;
-var init_trigger = __esm({
- "src/ts/area/trigger.ts"() {
- "use strict";
- init_is();
- (e => {
- function t(e, ...t) {
- if (Is.definedFunction(e)) {
- e.apply(null, [].slice.call(t, 0));
+(e => {
+ function t(e, ...t) {
+ if (Is.definedFunction(e)) {
+ e.apply(null, [].slice.call(t, 0));
+ }
+ }
+ e.customEvent = t;
+})(Trigger || (Trigger = {}));
+
+(() => {
+ let e = {};
+ const t = {};
+ let n = false;
+ function r() {
+ const t = e.domElementTypes;
+ const n = t.length;
+ for (let e = 0; e < n; e++) {
+ const n = document.getElementsByTagName(t[e]);
+ const r = [].slice.call(n);
+ const i = r.length;
+ for (let e = 0; e < i; e++) {
+ if (!o(r[e])) {
+ break;
}
}
- e.customEvent = t;
- })(Trigger || (Trigger = {}));
+ }
}
-});
-
-var require_observe = __commonJS({
- "src/observe.ts"(exports, module) {
- init_constant();
- init_enum();
- init_is();
- init_str();
- init_config();
- init_watch();
- init_trigger();
- (() => {
- let _configuration = {};
- const _watches = {};
- let _watches_Cancel = false;
- function collectDOMObjects() {
- const e = _configuration.domElementTypes;
- const t = e.length;
- for (let n = 0; n < t; n++) {
- const t = document.getElementsByTagName(e[n]);
- const r = [].slice.call(t);
- const o = r.length;
- for (let e = 0; e < o; e++) {
- if (!collectDOMObject(r[e])) {
- break;
- }
+ function o(t) {
+ let n = true;
+ if (Is.defined(t) && t.hasAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME)) {
+ const r = t.getAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
+ if (Is.definedString(r)) {
+ const o = Default2.getObjectFromString(r, e);
+ if (o.parsed && Is.definedObject(o.object)) {
+ const e = Watch.Options.get(o.object);
+ if (!Is.definedString(t.id)) {
+ t.id = crypto.randomUUID();
}
+ if (e.removeAttribute) {
+ t.removeAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
+ }
+ i(t, e, t.id);
+ } else {
+ Log.error(e.text.attributeNotValidErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME), e);
+ n = false;
}
+ } else {
+ Log.error(e.text.attributeNotSetErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME), e);
+ n = false;
}
- function collectDOMObject(e) {
- let t = true;
- if (Is.defined(e) && e.hasAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME)) {
- const n = e.getAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
- if (Is.definedString(n)) {
- const r = getObjectFromString(n);
- if (r.parsed && Is.definedObject(r.object)) {
- const t = Watch.Options.get(r.object);
- if (!Is.definedString(e.id)) {
- e.id = Str.newGuid();
- }
- if (t.removeAttribute) {
- e.removeAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
- }
- createWatch(e, t, e.id);
- } else {
- logError(_configuration.text.attributeNotValidErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME));
- t = false;
- }
+ }
+ return n;
+ }
+ function i(e, n, r = null) {
+ let o = null;
+ if (Is.definedObject(e)) {
+ o = crypto.randomUUID();
+ const i = Watch.Options.get(n);
+ const s = {};
+ let u = null;
+ s.options = i;
+ s.totalChanges = 0;
+ if (Is.definedString(r)) {
+ const e = document.getElementById(r);
+ if (Is.defined(e)) {
+ s.domElementId = r;
+ s.cachedObject = e.outerHTML;
+ s.originalObject = e.outerHTML;
+ u = e.outerHTML;
+ }
+ } else {
+ s.cachedObject = JSON.stringify(e);
+ s.originalObject = e;
+ u = e;
+ }
+ if (Is.defined(s.cachedObject)) {
+ Trigger.customEvent(s.options.events.onStart, u);
+ s.timerId = setInterval((() => {
+ a(i, o);
+ }), i.timeout);
+ t[o] = s;
+ }
+ }
+ return o;
+ }
+ function a(e, t) {
+ const n = new Date;
+ if (!Is.definedDate(e.starts) || n >= e.starts) {
+ s(t);
+ if (Is.definedDate(e.expires) && n >= e.expires) {
+ c(t);
+ }
+ }
+ }
+ function s(n) {
+ if (t.hasOwnProperty(n)) {
+ const r = t[n];
+ const o = Is.definedString(r.domElementId);
+ let i = null;
+ if (o) {
+ i = document.getElementById(r.domElementId);
+ if (Is.defined(i)) {
+ r.originalObject = i.outerHTML;
+ } else {
+ r.originalObject = "";
+ Trigger.customEvent(r.options.events.onRemove, r.domElementId);
+ }
+ }
+ const a = r.cachedObject;
+ const s = r.originalObject;
+ const l = !o ? JSON.stringify(s) : s;
+ if (a !== l) {
+ if (r.options.reset) {
+ if (o) {
+ i.outerHTML = r.cachedObject;
} else {
- logError(_configuration.text.attributeNotSetErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME));
- t = false;
+ r.originalObject = Default2.getObjectFromString(a, e).object;
}
+ } else {
+ r.cachedObject = l;
}
- return t;
- }
- function createWatch(e, t, n = null) {
- let r = null;
- if (Is.definedObject(e)) {
- r = Str.newGuid();
- const o = Watch.Options.get(t);
- const i = {};
- let s = null;
- i.options = o;
- i.totalChanges = 0;
- if (Is.definedString(n)) {
- const e = document.getElementById(n);
- if (Is.defined(e)) {
- i.domElementId = n;
- i.cachedObject = e.outerHTML;
- i.originalObject = e.outerHTML;
- s = e.outerHTML;
+ if (o) {
+ Trigger.customEvent(r.options.events.onChange, a, l);
+ } else {
+ const t = Default2.getObjectFromString(a, e).object;
+ const n = Default2.getObjectFromString(l, e).object;
+ if (!Is.definedArray(t) && !Is.definedArray(n)) {
+ u(t, n, r);
+ if (Is.definedFunction(r.options.events.onPropertyChange)) {
+ f(t, n, r);
}
} else {
- i.cachedObject = JSON.stringify(e);
- i.originalObject = e;
- s = e;
- }
- if (Is.defined(i.cachedObject)) {
- Trigger.customEvent(i.options.events.onStart, s);
- i.timer = setInterval((function() {
- watchTimer(o, r);
- }), o.timeout);
- _watches[r] = i;
+ Trigger.customEvent(r.options.events.onChange, t, n);
}
}
- return r;
+ r.totalChanges++;
+ if (r.options.pauseTimeoutOnChange > 0) {
+ g(n, r.options.pauseTimeoutOnChange);
+ }
+ if (r.options.cancelOnChange) {
+ c(n);
+ }
+ if (r.options.maximumChangesBeforeCanceling > 0 && r.totalChanges >= r.options.maximumChangesBeforeCanceling) {
+ c(n);
+ }
}
- function watchTimer(e, t) {
- const n = new Date;
- if (!Is.definedDate(e.starts) || n >= e.starts) {
- watchObjectForChanges(t);
- if (Is.definedDate(e.expires) && n >= e.expires) {
- cancelWatchObject(t);
- }
+ }
+ }
+ function u(e, t, n) {
+ if (Is.definedArray(n.options.propertyNames)) {
+ const r = n.options.propertyNames.length;
+ for (let o = 0; o < r; o++) {
+ const r = n.options.propertyNames[o];
+ if (e[r] !== t[r]) {
+ Trigger.customEvent(n.options.events.onChange, e, t);
+ break;
}
}
- function watchObjectForChanges(e) {
- if (_watches.hasOwnProperty(e)) {
- const t = _watches[e];
- const n = Is.definedString(t.domElementId);
- let r = null;
- if (n) {
- r = document.getElementById(t.domElementId);
- if (Is.defined(r)) {
- t.originalObject = r.outerHTML;
- } else {
- t.originalObject = "";
- Trigger.customEvent(t.options.events.onRemove, t.domElementId);
- }
- }
- const o = t.cachedObject;
- const i = t.originalObject;
- const s = !n ? JSON.stringify(i) : i;
- if (o !== s) {
- if (t.options.reset) {
- if (n) {
- r.outerHTML = t.cachedObject;
- } else {
- t.originalObject = getObjectFromString(o).object;
- }
- } else {
- t.cachedObject = s;
- }
- if (n) {
- Trigger.customEvent(t.options.events.onChange, o, s);
- } else {
- const e = getObjectFromString(o).object;
- const n = getObjectFromString(s).object;
- if (!Is.definedArray(e) && !Is.definedArray(n)) {
- compareWatchObject(e, n, t);
- if (Is.definedFunction(t.options.events.onPropertyChange)) {
- compareWatchObjectProperties(e, n, t);
- }
- } else {
- Trigger.customEvent(t.options.events.onChange, e, n);
- }
- }
- t.totalChanges++;
- if (t.options.pauseTimeoutOnChange > 0) {
- pauseWatchObject(e, t.options.pauseTimeoutOnChange);
- }
- if (t.options.cancelOnChange) {
- cancelWatchObject(e);
- }
- if (t.options.maximumChangesBeforeCanceling > 0 && t.totalChanges >= t.options.maximumChangesBeforeCanceling) {
- cancelWatchObject(e);
+ } else {
+ Trigger.customEvent(n.options.events.onChange, e, t);
+ }
+ }
+ function f(e, t, n) {
+ for (let r in e) {
+ if (e.hasOwnProperty(r)) {
+ const o = e[r];
+ let i = null;
+ if (t.hasOwnProperty(r)) {
+ i = t[r];
+ }
+ if (Is.definedObject(o) && Is.definedObject(i)) {
+ f(o, i, n);
+ } else {
+ if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) {
+ if (JSON.stringify(o) !== JSON.stringify(i)) {
+ Trigger.customEvent(n.options.events.onPropertyChange, r, o, i);
}
}
}
}
- function compareWatchObject(e, t, n) {
- if (Is.definedArray(n.options.propertyNames)) {
- const r = n.options.propertyNames.length;
- for (let o = 0; o < r; o++) {
- const r = n.options.propertyNames[o];
- if (e[r] !== t[r]) {
- Trigger.customEvent(n.options.events.onChange, e, t);
+ }
+ }
+ function l() {
+ for (let e in t) {
+ if (t.hasOwnProperty(e)) {
+ c(e);
+ }
+ }
+ }
+ function c(e) {
+ if (t.hasOwnProperty(e)) {
+ const r = t[e].options;
+ if (r.allowCanceling || n) {
+ Trigger.customEvent(r.events.onCancel, e);
+ clearInterval(t[e].timerId);
+ delete t[e];
+ }
+ }
+ }
+ function g(e, n) {
+ let r = false;
+ if (t.hasOwnProperty(e)) {
+ const o = t[e].options;
+ if (o.allowPausing) {
+ o.starts = new Date;
+ o.starts.setMilliseconds(o.starts.getMilliseconds() + n);
+ r = true;
+ }
+ }
+ return r;
+ }
+ function d(e, n) {
+ return t.hasOwnProperty(e) && Is.definedString(t[e].domElementId) && t[e].domElementId === n;
+ }
+ const p = {
+ watch: function(e, t) {
+ return i(e, t);
+ },
+ cancelWatch: function(e) {
+ let n = false;
+ if (Is.definedString(e)) {
+ if (t.hasOwnProperty(e)) {
+ c(e);
+ n = true;
+ } else {
+ for (let r in t) {
+ if (d(r, e)) {
+ c(r);
+ n = true;
break;
}
}
- } else {
- Trigger.customEvent(n.options.events.onChange, e, t);
}
}
- function compareWatchObjectProperties(e, t, n) {
- for (let r in e) {
- if (e.hasOwnProperty(r)) {
- const o = e[r];
- let i = null;
- if (t.hasOwnProperty(r)) {
- i = t[r];
- }
- if (Is.definedObject(o) && Is.definedObject(i)) {
- compareWatchObjectProperties(o, i, n);
- } else {
- if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) {
- if (JSON.stringify(o) !== JSON.stringify(i)) {
- Trigger.customEvent(n.options.events.onPropertyChange, r, o, i);
- }
- }
+ return n;
+ },
+ cancelWatches: function() {
+ l();
+ return p;
+ },
+ getWatch: function(e) {
+ let n = null;
+ if (Is.definedString(e)) {
+ if (t.hasOwnProperty(e)) {
+ n = t[e];
+ } else {
+ for (let r in t) {
+ if (d(r, e)) {
+ n = t[r];
+ break;
}
}
}
}
- function cancelWatchesForObjects() {
- for (let e in _watches) {
- if (_watches.hasOwnProperty(e)) {
- cancelWatchObject(e);
- }
- }
- }
- function cancelWatchObject(e) {
- if (_watches.hasOwnProperty(e)) {
- const t = _watches[e].options;
- if (t.allowCanceling || _watches_Cancel) {
- Trigger.customEvent(t.events.onCancel, e);
- clearInterval(_watches[e].timer);
- delete _watches[e];
+ return n;
+ },
+ getWatches: function() {
+ return t;
+ },
+ pauseWatch: function(e, n) {
+ let r = false;
+ if (Is.definedString(e) && Is.definedNumber(n)) {
+ if (t.hasOwnProperty(e)) {
+ r = g(e, n);
+ } else {
+ for (let o in t) {
+ if (d(o, e)) {
+ r = g(o, n);
+ break;
+ }
}
}
}
- function pauseWatchObject(e, t) {
- let n = false;
- if (_watches.hasOwnProperty(e)) {
- const r = _watches[e].options;
- if (r.allowPausing) {
- r.starts = new Date;
- r.starts.setMilliseconds(r.starts.getMilliseconds() + t);
- n = true;
+ return r;
+ },
+ pauseWatches: function(e) {
+ if (Is.definedNumber(e)) {
+ for (let n in t) {
+ if (t.hasOwnProperty(n)) {
+ g(n, e);
}
}
- return n;
}
- function getObjectFromString(objectString) {
- const result = {
- parsed: true,
- object: null
- };
- try {
- if (Is.definedString(objectString)) {
- result.object = JSON.parse(objectString);
- }
- } catch (e1) {
- try {
- result.object = eval(`(${objectString})`);
- if (Is.definedFunction(result.object)) {
- result.object = result.object();
- }
- } catch (e) {
- if (!_configuration.safeMode) {
- logError(_configuration.text.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message));
- result.parsed = false;
+ return p;
+ },
+ resumeWatch: function(e) {
+ let n = false;
+ if (Is.definedString(e)) {
+ if (t.hasOwnProperty(e)) {
+ t[e].options.starts = null;
+ n = true;
+ } else {
+ for (let r in t) {
+ if (d(r, e)) {
+ t[r].options.starts = null;
+ n = true;
+ break;
}
- result.object = null;
}
}
- return result;
}
- function logError(e) {
- let t = true;
- if (!_configuration.safeMode) {
- console.error(e);
- t = false;
+ return n;
+ },
+ resumeWatches: function() {
+ for (let e in t) {
+ if (t.hasOwnProperty(e)) {
+ t[e].options.starts = null;
}
- return t;
}
- const _public = {
- watch: function(e, t) {
- return createWatch(e, t);
- },
- cancelWatch: function(e) {
- let t = false;
- if (Is.definedString(e)) {
- if (_watches.hasOwnProperty(e)) {
- cancelWatchObject(e);
- t = true;
- } else {
- for (let n in _watches) {
- if (_watches.hasOwnProperty(n) && Is.definedString(_watches[n].domElementId) && _watches[n].domElementId === e) {
- cancelWatchObject(n);
- t = true;
- break;
- }
- }
- }
- }
- return t;
- },
- cancelWatches: function() {
- cancelWatchesForObjects();
- return _public;
- },
- getWatch: function(e) {
- let t = null;
- if (Is.definedString(e)) {
- if (_watches.hasOwnProperty(e)) {
- t = _watches[e];
- } else {
- for (let n in _watches) {
- if (_watches.hasOwnProperty(n) && Is.definedString(_watches[n].domElementId) && _watches[n].domElementId === e) {
- t = _watches[n];
- break;
- }
- }
- }
- }
- return t;
- },
- getWatches: function() {
- return _watches;
- },
- pauseWatch: function(e, t) {
- let n = false;
- if (Is.definedString(e) && Is.definedNumber(t)) {
- if (_watches.hasOwnProperty(e)) {
- n = pauseWatchObject(e, t);
- } else {
- for (let r in _watches) {
- if (_watches.hasOwnProperty(r) && Is.definedString(_watches[r].domElementId) && _watches[r].domElementId === e) {
- n = pauseWatchObject(r, t);
- break;
- }
- }
- }
- }
- return n;
- },
- pauseWatches: function(e) {
- if (Is.definedNumber(e)) {
- for (let t in _watches) {
- if (_watches.hasOwnProperty(t)) {
- pauseWatchObject(t, e);
- }
- }
- }
- return _public;
- },
- resumeWatch: function(e) {
- let t = false;
- if (Is.definedString(e)) {
- if (_watches.hasOwnProperty(e)) {
- _watches[e].options.starts = null;
- t = true;
- } else {
- for (let n in _watches) {
- if (_watches.hasOwnProperty(n) && Is.definedString(_watches[n].domElementId) && _watches[n].domElementId === e) {
- _watches[n].options.starts = null;
- t = true;
- break;
- }
- }
- }
- }
- return t;
- },
- resumeWatches: function() {
- for (let e in _watches) {
- if (_watches.hasOwnProperty(e)) {
- _watches[e].options.starts = null;
- }
- }
- return _public;
- },
- searchDomForNewWatches: function() {
- collectDOMObjects();
- return _public;
- },
- setConfiguration: function(e) {
- if (Is.definedObject(e)) {
- let t = false;
- const n = _configuration;
- for (let r in e) {
- if (e.hasOwnProperty(r) && _configuration.hasOwnProperty(r) && n[r] !== e[r]) {
- n[r] = e[r];
- t = true;
- }
- }
- if (t) {
- _configuration = Config.Options.get(n);
- }
+ return p;
+ },
+ searchDomForNewWatches: function() {
+ r();
+ return p;
+ },
+ setConfiguration: function(t) {
+ if (Is.definedObject(t)) {
+ let n = false;
+ const r = e;
+ for (let o in t) {
+ if (t.hasOwnProperty(o) && e.hasOwnProperty(o) && r[o] !== t[o]) {
+ r[o] = t[o];
+ n = true;
}
- return _public;
- },
- getVersion: function() {
- return "1.0.1";
}
- };
- (() => {
- _configuration = Config.Options.get();
- document.addEventListener("DOMContentLoaded", (function() {
- collectDOMObjects();
- }));
- window.addEventListener("pagehide", (function() {
- _watches_Cancel = true;
- cancelWatchesForObjects();
- }));
- if (!Is.defined(window.$observe)) {
- window.$observe = _public;
+ if (n) {
+ e = Config.Options.get(r);
}
- })();
- })();
- }
-});
-
-export default require_observe();//# sourceMappingURL=observe.esm.js.map
\ No newline at end of file
+ }
+ return p;
+ },
+ getVersion: function() {
+ return "1.1.0";
+ }
+ };
+ (() => {
+ e = Config.Options.get();
+ document.addEventListener("DOMContentLoaded", (() => r()));
+ window.addEventListener("pagehide", (() => {
+ n = true;
+ l();
+ }));
+ if (!Is.defined(window.$observe)) {
+ window.$observe = p;
+ }
+ })();
+})();//# sourceMappingURL=observe.esm.js.map
\ No newline at end of file
diff --git a/dist/observe.esm.js.map b/dist/observe.esm.js.map
index 06939de..ba495db 100644
--- a/dist/observe.esm.js.map
+++ b/dist/observe.esm.js.map
@@ -1 +1 @@
-{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["__getOwnPropNames","Object","getOwnPropertyNames","__esm","fn","res","__init","__commonJS","cb","mod","__require","exports","Constant","init_constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","init_enum","Is","init_is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","init_str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","init_default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","init_config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","init_watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","Trigger","init_trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","require_observe","module","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA,IAAIA,oBAAoBC,OAAOC;;AAC/B,IAAIC,QAAQ,CAACC,GAAIC,MAAQ,SAASC;IAChC,OAAOF,MAAOC,KAAO,GAAGD,EAAGJ,kBAAkBI,GAAI,KAAKA,IAAK,KAAKC;AAClE;;AACA,IAAIE,aAAa,CAACC,GAAIC,MAAQ,SAASC;IACrC,OAAOD,MAAQ,GAAGD,EAAGR,kBAAkBQ,GAAI,MAAMC,IAAM;QAAEE,SAAS,CAAC;OAAKA,SAASF,IAAMA,EAAIE;AAC7F;;AAGA,IAAIC;;AACJ,IAAIC,gBAAgBV,MAAM;IACxB;QACE;QACA,CAAEW;YACAA,EAAUC,4BAA4B;AACvC,UAFD,CAEGH,aAAaA,WAAW,CAAC;AAC9B;;;AAIF,IAAII,YAAYb,MAAM;IACpB;QACE;AACF;;;AAIF,IAAIc;;AACJ,IAAIC,UAAUf,MAAM;IAClB;QACE;QACAa;QACA,CAAEG;YACA,SAASC,EAAQC;gBACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;YACAH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BuF,eAAeY,MAAiBxD,eAAe4C,eAAeY,MAAiB8B,EAAyB9B,OAAkBnG,EAAiBmG,IAAe;gCAC7K8B,EAAyB9B,KAAgBnG,EAAiBmG;gCAC1D6B,IAA0B;AAC5B;AACF;wBACA,IAAIA,GAAyB;4BAC3BrF,iBAAiBjD,OAAOG,QAAQE,IAAIkI;AACtC;AACF;oBACA,OAAOZ;AACT;gBAMAa,YAAY;oBACV,OAAO;AACT;;YAEF;gBACEvF,iBAAiBjD,OAAOG,QAAQE;gBAChCoD,SAASgF,iBAAiB,qBAAoB;oBAC5CrF;AACF;gBACAsF,OAAOD,iBAAiB,aAAY;oBAClCtF,kBAAkB;oBAClB0D;AACF;gBACA,KAAKzJ,GAAGG,QAAQmL,OAAOC,WAAW;oBAChCD,OAAOC,WAAWhB;AACpB;AACD,cAZD;AAaD,UAhYD;AAiYF;;;eAEa5E","sourcesContent":[null]}
\ No newline at end of file
+{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.esm.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Log","Log2","error","error2","configuration2","result2","safeMode","console","Default2","Default","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","getObjectFromString","objectString","configuration","result","parsed","JSON","parse","e1","eval","e2","text","objectErrorText","replace","message","Config","Config2","Options","Options2","get","newConfiguration","domElementTypes","getText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","watchOptions","id","crypto","randomUUID","createWatch","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","stringify","timerId","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","isWatchDomIdAvailable","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AACA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA;IACpB,S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IAAiBxC,OAAOE,QAAQE,IAAI+G;AACtC;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACE5E,IAAiBxC,OAAOE,QAAQE;QAChC4C,SAASqE,iBAAiB,qBAAoB,MAAM1E;QACpD2E,OAAOD,iBAAiB,aAAY;YAClC3E,IAAkB;YAClBuD;AAAyB;QAE3B,KAAKrJ,GAAGE,QAAQwK,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAVD;AAWD,EAhWD","sourcesContent":[null]}
\ No newline at end of file
diff --git a/dist/observe.js b/dist/observe.js
index d90d645..bd0cb18 100644
--- a/dist/observe.js
+++ b/dist/observe.js
@@ -33,69 +33,66 @@ var Is;
return t(e) && typeof e === "number";
}
e.definedNumber = a;
- function c(e) {
+ function s(e) {
return n(e) && e instanceof Array;
}
- e.definedArray = c;
- function s(e) {
+ e.definedArray = s;
+ function u(e) {
return n(e) && e instanceof Date;
}
- e.definedDate = s;
+ e.definedDate = u;
})(Is || (Is = {}));
-var Str;
+var Log;
(e => {
- function t() {
- const e = [];
- for (let t = 0; t < 32; t++) {
- if (t === 8 || t === 12 || t === 16 || t === 20) {
- e.push("-");
- }
- const n = Math.floor(Math.random() * 16).toString(16);
- e.push(n);
+ function t(e, t) {
+ let n = true;
+ if (!t.safeMode) {
+ console.error(e);
+ n = false;
}
- return e.join("");
+ return n;
}
- e.newGuid = t;
-})(Str || (Str = {}));
+ e.error = t;
+})(Log || (Log = {}));
-var Default;
+var Default2;
-(e => {
- function t(e, t) {
+(Default => {
+ function getAnyString(e, t) {
return typeof e === "string" ? e : t;
}
- e.getAnyString = t;
- function n(e, t) {
+ Default.getAnyString = getAnyString;
+ function getString(e, t) {
return Is.definedString(e) ? e : t;
}
- e.getString = n;
- function r(e, t) {
+ Default.getString = getString;
+ function getBoolean(e, t) {
return Is.definedBoolean(e) ? e : t;
}
- e.getBoolean = r;
- function o(e, t) {
+ Default.getBoolean = getBoolean;
+ function getNumber(e, t) {
return Is.definedNumber(e) ? e : t;
}
- e.getNumber = o;
- function i(e, t) {
+ Default.getNumber = getNumber;
+ function getFunction(e, t) {
return Is.definedFunction(e) ? e : t;
}
- e.getFunction = i;
- function a(e, t) {
+ Default.getFunction = getFunction;
+ function getArray(e, t) {
return Is.definedArray(e) ? e : t;
}
- e.getArray = a;
- function c(e, t) {
+ Default.getArray = getArray;
+ function getObject(e, t) {
return Is.definedObject(e) ? e : t;
}
- e.getObject = c;
- function s(e, t) {
+ Default.getObject = getObject;
+ function getDate(e, t) {
return Is.definedDate(e) ? e : t;
}
- e.getDate = s;
- function l(e, t) {
+ Default.getDate = getDate;
+ function getStringOrArray(e, t) {
let n = t;
if (Is.definedString(e)) {
const r = e.toString().split("space");
@@ -105,12 +102,39 @@ var Default;
n = r;
}
} else {
- n = a(e, t);
+ n = getArray(e, t);
}
return n;
}
- e.getStringOrArray = l;
-})(Default || (Default = {}));
+ Default.getStringOrArray = getStringOrArray;
+ function getObjectFromString(objectString, configuration) {
+ const result = {
+ parsed: true,
+ object: null
+ };
+ try {
+ if (Is.definedString(objectString)) {
+ result.object = JSON.parse(objectString);
+ }
+ } catch (e1) {
+ try {
+ result.object = eval(`(${objectString})`);
+ if (Is.definedFunction(result.object)) {
+ result.object = result.object();
+ configuration;
+ }
+ } catch (e) {
+ if (!configuration.safeMode) {
+ Log.error(configuration.text.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message), configuration);
+ result.parsed = false;
+ }
+ result.object = null;
+ }
+ }
+ return result;
+ }
+ Default.getObjectFromString = getObjectFromString;
+})(Default2 || (Default2 = {}));
var Config;
@@ -118,18 +142,18 @@ var Config;
let t;
(e => {
function t(e = null) {
- let t = Default.getObject(e, {});
- t.safeMode = Default.getBoolean(t.safeMode, true);
- t.domElementTypes = Default.getStringOrArray(t.domElementTypes, [ "*" ]);
+ let t = Default2.getObject(e, {});
+ t.safeMode = Default2.getBoolean(t.safeMode, true);
+ t.domElementTypes = Default2.getStringOrArray(t.domElementTypes, [ "*" ]);
t = n(t);
return t;
}
e.get = t;
function n(e) {
- e.text = Default.getObject(e.text, {});
- e.text.objectErrorText = Default.getString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
- e.text.attributeNotValidErrorText = Default.getString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
- e.text.attributeNotSetErrorText = Default.getString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
+ e.text = Default2.getObject(e.text, {});
+ e.text.objectErrorText = Default2.getString(e.text.objectErrorText, "Errors in object: {{error_1}}, {{error_2}}");
+ e.text.attributeNotValidErrorText = Default2.getString(e.text.attributeNotValidErrorText, "The attribute '{{attribute_name}}' is not a valid object.");
+ e.text.attributeNotSetErrorText = Default2.getString(e.text.attributeNotSetErrorText, "The attribute '{{attribute_name}}' has not been set correctly.");
return e;
}
})(t = e.Options || (e.Options = {}));
@@ -141,29 +165,29 @@ var Watch;
let t;
(e => {
function t(e) {
- let t = Default.getObject(e, {});
- t.timeout = Default.getNumber(t.timeout, 250);
- t.starts = Default.getDate(t.starts, null);
- t.expires = Default.getDate(t.expires, null);
- t.reset = Default.getBoolean(t.reset, false);
- t.cancelOnChange = Default.getBoolean(t.cancelOnChange, false);
- t.maximumChangesBeforeCanceling = Default.getNumber(t.maximumChangesBeforeCanceling, 0);
- t.pauseTimeoutOnChange = Default.getNumber(t.pauseTimeoutOnChange, 0);
- t.propertyNames = Default.getArray(t.propertyNames, null);
- t.allowCanceling = Default.getBoolean(t.allowCanceling, true);
- t.allowPausing = Default.getBoolean(t.allowPausing, true);
- t.removeAttribute = Default.getBoolean(t.removeAttribute, true);
+ let t = Default2.getObject(e, {});
+ t.timeout = Default2.getNumber(t.timeout, 250);
+ t.starts = Default2.getDate(t.starts, null);
+ t.expires = Default2.getDate(t.expires, null);
+ t.reset = Default2.getBoolean(t.reset, false);
+ t.cancelOnChange = Default2.getBoolean(t.cancelOnChange, false);
+ t.maximumChangesBeforeCanceling = Default2.getNumber(t.maximumChangesBeforeCanceling, 0);
+ t.pauseTimeoutOnChange = Default2.getNumber(t.pauseTimeoutOnChange, 0);
+ t.propertyNames = Default2.getArray(t.propertyNames, null);
+ t.allowCanceling = Default2.getBoolean(t.allowCanceling, true);
+ t.allowPausing = Default2.getBoolean(t.allowPausing, true);
+ t.removeAttribute = Default2.getBoolean(t.removeAttribute, true);
t = n(t);
return t;
}
e.get = t;
function n(e) {
- e.events = Default.getObject(e.events, {});
- e.events.onChange = Default.getFunction(e.events.onChange, null);
- e.events.onPropertyChange = Default.getFunction(e.events.onPropertyChange, null);
- e.events.onCancel = Default.getFunction(e.events.onCancel, null);
- e.events.onRemove = Default.getFunction(e.events.onRemove, null);
- e.events.onStart = Default.getFunction(e.events.onStart, null);
+ e.events = Default2.getObject(e.events, {});
+ e.events.onChange = Default2.getFunction(e.events.onChange, null);
+ e.events.onPropertyChange = Default2.getFunction(e.events.onPropertyChange, null);
+ e.events.onCancel = Default2.getFunction(e.events.onCancel, null);
+ e.events.onRemove = Default2.getFunction(e.events.onRemove, null);
+ e.events.onStart = Default2.getFunction(e.events.onStart, null);
return e;
}
})(t = e.Options || (e.Options = {}));
@@ -181,145 +205,145 @@ var Trigger;
})(Trigger || (Trigger = {}));
(() => {
- let _configuration = {};
- const _watches = {};
- let _watches_Cancel = false;
- function collectDOMObjects() {
- const e = _configuration.domElementTypes;
- const t = e.length;
- for (let n = 0; n < t; n++) {
- const t = document.getElementsByTagName(e[n]);
- const r = [].slice.call(t);
- const o = r.length;
- for (let e = 0; e < o; e++) {
- if (!collectDOMObject(r[e])) {
+ let e = {};
+ const t = {};
+ let n = false;
+ function r() {
+ const t = e.domElementTypes;
+ const n = t.length;
+ for (let e = 0; e < n; e++) {
+ const n = document.getElementsByTagName(t[e]);
+ const r = [].slice.call(n);
+ const i = r.length;
+ for (let e = 0; e < i; e++) {
+ if (!o(r[e])) {
break;
}
}
}
}
- function collectDOMObject(e) {
- let t = true;
- if (Is.defined(e) && e.hasAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME)) {
- const n = e.getAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
- if (Is.definedString(n)) {
- const r = getObjectFromString(n);
- if (r.parsed && Is.definedObject(r.object)) {
- const t = Watch.Options.get(r.object);
- if (!Is.definedString(e.id)) {
- e.id = Str.newGuid();
+ function o(t) {
+ let n = true;
+ if (Is.defined(t) && t.hasAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME)) {
+ const r = t.getAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
+ if (Is.definedString(r)) {
+ const o = Default2.getObjectFromString(r, e);
+ if (o.parsed && Is.definedObject(o.object)) {
+ const e = Watch.Options.get(o.object);
+ if (!Is.definedString(t.id)) {
+ t.id = crypto.randomUUID();
}
- if (t.removeAttribute) {
- e.removeAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
+ if (e.removeAttribute) {
+ t.removeAttribute(Constant.OBSERVE_JS_ATTRIBUTE_NAME);
}
- createWatch(e, t, e.id);
+ i(t, e, t.id);
} else {
- logError(_configuration.text.attributeNotValidErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME));
- t = false;
+ Log.error(e.text.attributeNotValidErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME), e);
+ n = false;
}
} else {
- logError(_configuration.text.attributeNotSetErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME));
- t = false;
+ Log.error(e.text.attributeNotSetErrorText.replace("{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME), e);
+ n = false;
}
}
- return t;
+ return n;
}
- function createWatch(e, t, n = null) {
- let r = null;
+ function i(e, n, r = null) {
+ let o = null;
if (Is.definedObject(e)) {
- r = Str.newGuid();
- const o = Watch.Options.get(t);
- const i = {};
- let a = null;
- i.options = o;
- i.totalChanges = 0;
- if (Is.definedString(n)) {
- const e = document.getElementById(n);
+ o = crypto.randomUUID();
+ const i = Watch.Options.get(n);
+ const s = {};
+ let u = null;
+ s.options = i;
+ s.totalChanges = 0;
+ if (Is.definedString(r)) {
+ const e = document.getElementById(r);
if (Is.defined(e)) {
- i.domElementId = n;
- i.cachedObject = e.outerHTML;
- i.originalObject = e.outerHTML;
- a = e.outerHTML;
+ s.domElementId = r;
+ s.cachedObject = e.outerHTML;
+ s.originalObject = e.outerHTML;
+ u = e.outerHTML;
}
} else {
- i.cachedObject = JSON.stringify(e);
- i.originalObject = e;
- a = e;
+ s.cachedObject = JSON.stringify(e);
+ s.originalObject = e;
+ u = e;
}
- if (Is.defined(i.cachedObject)) {
- Trigger.customEvent(i.options.events.onStart, a);
- i.timer = setInterval((function() {
- watchTimer(o, r);
- }), o.timeout);
- _watches[r] = i;
+ if (Is.defined(s.cachedObject)) {
+ Trigger.customEvent(s.options.events.onStart, u);
+ s.timerId = setInterval((() => {
+ a(i, o);
+ }), i.timeout);
+ t[o] = s;
}
}
- return r;
+ return o;
}
- function watchTimer(e, t) {
+ function a(e, t) {
const n = new Date;
if (!Is.definedDate(e.starts) || n >= e.starts) {
- watchObjectForChanges(t);
+ s(t);
if (Is.definedDate(e.expires) && n >= e.expires) {
- cancelWatchObject(t);
+ c(t);
}
}
}
- function watchObjectForChanges(e) {
- if (_watches.hasOwnProperty(e)) {
- const t = _watches[e];
- const n = Is.definedString(t.domElementId);
- let r = null;
- if (n) {
- r = document.getElementById(t.domElementId);
- if (Is.defined(r)) {
- t.originalObject = r.outerHTML;
+ function s(n) {
+ if (t.hasOwnProperty(n)) {
+ const r = t[n];
+ const o = Is.definedString(r.domElementId);
+ let i = null;
+ if (o) {
+ i = document.getElementById(r.domElementId);
+ if (Is.defined(i)) {
+ r.originalObject = i.outerHTML;
} else {
- t.originalObject = "";
- Trigger.customEvent(t.options.events.onRemove, t.domElementId);
+ r.originalObject = "";
+ Trigger.customEvent(r.options.events.onRemove, r.domElementId);
}
}
- const o = t.cachedObject;
- const i = t.originalObject;
- const a = !n ? JSON.stringify(i) : i;
- if (o !== a) {
- if (t.options.reset) {
- if (n) {
- r.outerHTML = t.cachedObject;
+ const a = r.cachedObject;
+ const s = r.originalObject;
+ const l = !o ? JSON.stringify(s) : s;
+ if (a !== l) {
+ if (r.options.reset) {
+ if (o) {
+ i.outerHTML = r.cachedObject;
} else {
- t.originalObject = getObjectFromString(o).object;
+ r.originalObject = Default2.getObjectFromString(a, e).object;
}
} else {
- t.cachedObject = a;
+ r.cachedObject = l;
}
- if (n) {
- Trigger.customEvent(t.options.events.onChange, o, a);
+ if (o) {
+ Trigger.customEvent(r.options.events.onChange, a, l);
} else {
- const e = getObjectFromString(o).object;
- const n = getObjectFromString(a).object;
- if (!Is.definedArray(e) && !Is.definedArray(n)) {
- compareWatchObject(e, n, t);
- if (Is.definedFunction(t.options.events.onPropertyChange)) {
- compareWatchObjectProperties(e, n, t);
+ const t = Default2.getObjectFromString(a, e).object;
+ const n = Default2.getObjectFromString(l, e).object;
+ if (!Is.definedArray(t) && !Is.definedArray(n)) {
+ u(t, n, r);
+ if (Is.definedFunction(r.options.events.onPropertyChange)) {
+ f(t, n, r);
}
} else {
- Trigger.customEvent(t.options.events.onChange, e, n);
+ Trigger.customEvent(r.options.events.onChange, t, n);
}
}
- t.totalChanges++;
- if (t.options.pauseTimeoutOnChange > 0) {
- pauseWatchObject(e, t.options.pauseTimeoutOnChange);
+ r.totalChanges++;
+ if (r.options.pauseTimeoutOnChange > 0) {
+ g(n, r.options.pauseTimeoutOnChange);
}
- if (t.options.cancelOnChange) {
- cancelWatchObject(e);
+ if (r.options.cancelOnChange) {
+ c(n);
}
- if (t.options.maximumChangesBeforeCanceling > 0 && t.totalChanges >= t.options.maximumChangesBeforeCanceling) {
- cancelWatchObject(e);
+ if (r.options.maximumChangesBeforeCanceling > 0 && r.totalChanges >= r.options.maximumChangesBeforeCanceling) {
+ c(n);
}
}
}
}
- function compareWatchObject(e, t, n) {
+ function u(e, t, n) {
if (Is.definedArray(n.options.propertyNames)) {
const r = n.options.propertyNames.length;
for (let o = 0; o < r; o++) {
@@ -333,7 +357,7 @@ var Trigger;
Trigger.customEvent(n.options.events.onChange, e, t);
}
}
- function compareWatchObjectProperties(e, t, n) {
+ function f(e, t, n) {
for (let r in e) {
if (e.hasOwnProperty(r)) {
const o = e[r];
@@ -342,7 +366,7 @@ var Trigger;
i = t[r];
}
if (Is.definedObject(o) && Is.definedObject(i)) {
- compareWatchObjectProperties(o, i, n);
+ f(o, i, n);
} else {
if (!Is.definedArray(n.options.propertyNames) || n.options.propertyNames.indexOf(r) > -1) {
if (JSON.stringify(o) !== JSON.stringify(i)) {
@@ -353,200 +377,168 @@ var Trigger;
}
}
}
- function cancelWatchesForObjects() {
- for (let e in _watches) {
- if (_watches.hasOwnProperty(e)) {
- cancelWatchObject(e);
- }
- }
- }
- function cancelWatchObject(e) {
- if (_watches.hasOwnProperty(e)) {
- const t = _watches[e].options;
- if (t.allowCanceling || _watches_Cancel) {
- Trigger.customEvent(t.events.onCancel, e);
- clearInterval(_watches[e].timer);
- delete _watches[e];
+ function l() {
+ for (let e in t) {
+ if (t.hasOwnProperty(e)) {
+ c(e);
}
}
}
- function pauseWatchObject(e, t) {
- let n = false;
- if (_watches.hasOwnProperty(e)) {
- const r = _watches[e].options;
- if (r.allowPausing) {
- r.starts = new Date;
- r.starts.setMilliseconds(r.starts.getMilliseconds() + t);
- n = true;
+ function c(e) {
+ if (t.hasOwnProperty(e)) {
+ const r = t[e].options;
+ if (r.allowCanceling || n) {
+ Trigger.customEvent(r.events.onCancel, e);
+ clearInterval(t[e].timerId);
+ delete t[e];
}
}
- return n;
}
- function getObjectFromString(objectString) {
- const result = {
- parsed: true,
- object: null
- };
- try {
- if (Is.definedString(objectString)) {
- result.object = JSON.parse(objectString);
- }
- } catch (e1) {
- try {
- result.object = eval(`(${objectString})`);
- if (Is.definedFunction(result.object)) {
- result.object = result.object();
- }
- } catch (e) {
- if (!_configuration.safeMode) {
- logError(_configuration.text.objectErrorText.replace("{{error_1}}", e1.message).replace("{{error_2}}", e.message));
- result.parsed = false;
- }
- result.object = null;
+ function g(e, n) {
+ let r = false;
+ if (t.hasOwnProperty(e)) {
+ const o = t[e].options;
+ if (o.allowPausing) {
+ o.starts = new Date;
+ o.starts.setMilliseconds(o.starts.getMilliseconds() + n);
+ r = true;
}
}
- return result;
+ return r;
}
- function logError(e) {
- let t = true;
- if (!_configuration.safeMode) {
- console.error(e);
- t = false;
- }
- return t;
+ function d(e, n) {
+ return t.hasOwnProperty(e) && Is.definedString(t[e].domElementId) && t[e].domElementId === n;
}
- const _public = {
+ const p = {
watch: function(e, t) {
- return createWatch(e, t);
+ return i(e, t);
},
cancelWatch: function(e) {
- let t = false;
+ let n = false;
if (Is.definedString(e)) {
- if (_watches.hasOwnProperty(e)) {
- cancelWatchObject(e);
- t = true;
+ if (t.hasOwnProperty(e)) {
+ c(e);
+ n = true;
} else {
- for (let n in _watches) {
- if (_watches.hasOwnProperty(n) && Is.definedString(_watches[n].domElementId) && _watches[n].domElementId === e) {
- cancelWatchObject(n);
- t = true;
+ for (let r in t) {
+ if (d(r, e)) {
+ c(r);
+ n = true;
break;
}
}
}
}
- return t;
+ return n;
},
cancelWatches: function() {
- cancelWatchesForObjects();
- return _public;
+ l();
+ return p;
},
getWatch: function(e) {
- let t = null;
+ let n = null;
if (Is.definedString(e)) {
- if (_watches.hasOwnProperty(e)) {
- t = _watches[e];
+ if (t.hasOwnProperty(e)) {
+ n = t[e];
} else {
- for (let n in _watches) {
- if (_watches.hasOwnProperty(n) && Is.definedString(_watches[n].domElementId) && _watches[n].domElementId === e) {
- t = _watches[n];
+ for (let r in t) {
+ if (d(r, e)) {
+ n = t[r];
break;
}
}
}
}
- return t;
+ return n;
},
getWatches: function() {
- return _watches;
+ return t;
},
- pauseWatch: function(e, t) {
- let n = false;
- if (Is.definedString(e) && Is.definedNumber(t)) {
- if (_watches.hasOwnProperty(e)) {
- n = pauseWatchObject(e, t);
+ pauseWatch: function(e, n) {
+ let r = false;
+ if (Is.definedString(e) && Is.definedNumber(n)) {
+ if (t.hasOwnProperty(e)) {
+ r = g(e, n);
} else {
- for (let r in _watches) {
- if (_watches.hasOwnProperty(r) && Is.definedString(_watches[r].domElementId) && _watches[r].domElementId === e) {
- n = pauseWatchObject(r, t);
+ for (let o in t) {
+ if (d(o, e)) {
+ r = g(o, n);
break;
}
}
}
}
- return n;
+ return r;
},
pauseWatches: function(e) {
if (Is.definedNumber(e)) {
- for (let t in _watches) {
- if (_watches.hasOwnProperty(t)) {
- pauseWatchObject(t, e);
+ for (let n in t) {
+ if (t.hasOwnProperty(n)) {
+ g(n, e);
}
}
}
- return _public;
+ return p;
},
resumeWatch: function(e) {
- let t = false;
+ let n = false;
if (Is.definedString(e)) {
- if (_watches.hasOwnProperty(e)) {
- _watches[e].options.starts = null;
- t = true;
+ if (t.hasOwnProperty(e)) {
+ t[e].options.starts = null;
+ n = true;
} else {
- for (let n in _watches) {
- if (_watches.hasOwnProperty(n) && Is.definedString(_watches[n].domElementId) && _watches[n].domElementId === e) {
- _watches[n].options.starts = null;
- t = true;
+ for (let r in t) {
+ if (d(r, e)) {
+ t[r].options.starts = null;
+ n = true;
break;
}
}
}
}
- return t;
+ return n;
},
resumeWatches: function() {
- for (let e in _watches) {
- if (_watches.hasOwnProperty(e)) {
- _watches[e].options.starts = null;
+ for (let e in t) {
+ if (t.hasOwnProperty(e)) {
+ t[e].options.starts = null;
}
}
- return _public;
+ return p;
},
searchDomForNewWatches: function() {
- collectDOMObjects();
- return _public;
+ r();
+ return p;
},
- setConfiguration: function(e) {
- if (Is.definedObject(e)) {
- let t = false;
- const n = _configuration;
- for (let r in e) {
- if (e.hasOwnProperty(r) && _configuration.hasOwnProperty(r) && n[r] !== e[r]) {
- n[r] = e[r];
- t = true;
+ setConfiguration: function(t) {
+ if (Is.definedObject(t)) {
+ let n = false;
+ const r = e;
+ for (let o in t) {
+ if (t.hasOwnProperty(o) && e.hasOwnProperty(o) && r[o] !== t[o]) {
+ r[o] = t[o];
+ n = true;
}
}
- if (t) {
- _configuration = Config.Options.get(n);
+ if (n) {
+ e = Config.Options.get(r);
}
}
- return _public;
+ return p;
},
getVersion: function() {
- return "1.0.1";
+ return "1.1.0";
}
};
(() => {
- _configuration = Config.Options.get();
- document.addEventListener("DOMContentLoaded", (function() {
- collectDOMObjects();
- }));
- window.addEventListener("pagehide", (function() {
- _watches_Cancel = true;
- cancelWatchesForObjects();
+ e = Config.Options.get();
+ document.addEventListener("DOMContentLoaded", (() => r()));
+ window.addEventListener("pagehide", (() => {
+ n = true;
+ l();
}));
if (!Is.defined(window.$observe)) {
- window.$observe = _public;
+ window.$observe = p;
}
})();
})();//# sourceMappingURL=observe.js.map
\ No newline at end of file
diff --git a/dist/observe.js.map b/dist/observe.js.map
index dec18e4..e768bba 100644
--- a/dist/observe.js.map
+++ b/dist/observe.js.map
@@ -1 +1 @@
-{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Str","Str2","newGuid","result2","charIndex","push","character","Math","floor","random","join","Default","Default2","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","Config","Config2","Options","Options2","get","newConfiguration","configuration","safeMode","domElementTypes","getText","text","objectErrorText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","getObjectFromString","parsed","watchOptions","id","createWatch","logError","replace","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","JSON","stringify","timer","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","objectString","result","parse","e1","eval","e2","message","error","console","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,gBAAgBA;IACpB,SAASC,EAAgBH;QACvB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIQ,kBAAkBA;IACtB,SAASC,EAAcJ;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIS,gBAAgBA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mG;AACT;QACAS,wBAAwB;YACtBhF;YACA,OAAOuE;AACT;QAMAU,kBAAkB,SAAS3H;YACzB,IAAI9C,GAAGK,cAAcyC,IAAmB;gBACtC,IAAI4H,IAA0B;gBAC9B,MAAMC,IAA2BtF;gBACjC,KAAK,IAAIwD,KAAgB/F,GAAkB;oBACzC,IAAIA,EAAiBmF,eAAeY,MAAiBxD,eAAe4C,eAAeY,MAAiB8B,EAAyB9B,OAAkB/F,EAAiB+F,IAAe;wBAC7K8B,EAAyB9B,KAAgB/F,EAAiB+F;wBAC1D6B,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3BrF,iBAAiB5C,OAAOE,QAAQE,IAAI8H;AACtC;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACEvF,iBAAiB5C,OAAOE,QAAQE;QAChCgD,SAASgF,iBAAiB,qBAAoB;YAC5CrF;AACF;QACAsF,OAAOD,iBAAiB,aAAY;YAClCtF,kBAAkB;YAClB0D;AACF;QACA,KAAKjJ,GAAGE,QAAQ4K,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAZD;AAaD,EAhYD","sourcesContent":[null]}
\ No newline at end of file
+{"version":3,"sources":["/Users/williamtroup/Documents/GitHub%20Repos/Observe.js/dist/observe.js"],"names":["Constant","Constant2","OBSERVE_JS_ATTRIBUTE_NAME","Is","Is2","defined","value","toString","definedObject","object","definedBoolean","definedString","definedFunction","definedNumber","definedArray","Array","definedDate","Date","Log","Log2","error","error2","configuration2","result2","safeMode","console","Default2","Default","getAnyString","defaultValue","getString","getBoolean","getNumber","getFunction","getArray","getObject","getDate","getStringOrArray","values","split","length","getObjectFromString","objectString","configuration","result","parsed","JSON","parse","e1","eval","e2","text","objectErrorText","replace","message","Config","Config2","Options","Options2","get","newConfiguration","domElementTypes","getText","attributeNotValidErrorText","attributeNotSetErrorText","Watch","Watch2","newOptions","options","timeout","starts","expires","reset","cancelOnChange","maximumChangesBeforeCanceling","pauseTimeoutOnChange","propertyNames","allowCanceling","allowPausing","removeAttribute","getEvents","events","onChange","onPropertyChange","onCancel","onRemove","onStart","Trigger","Trigger2","customEvent","triggerFunction","args","apply","slice","call","_configuration","_watches","_watches_Cancel","collectDOMObjects","tagTypes","tagTypesLength","tagTypeIndex","domElements","document","getElementsByTagName","elements","elementsLength","elementIndex","collectDOMObject","element","hasAttribute","bindingOptionsData","getAttribute","watchOptionsJson","watchOptions","id","crypto","randomUUID","createWatch","domElementId","storageId","watch","startWatchObject","totalChanges","domElement","getElementById","cachedObject","outerHTML","originalObject","stringify","timerId","setInterval","watchTimer","currentDateTime","watchObjectForChanges","cancelWatchObject","hasOwnProperty","isDomElement","originalObjectJson","oldValue","newValue","compareWatchObject","compareWatchObjectProperties","pauseWatchObject","oldObject","newObject","propertyNamesLength","propertyNameIndex","propertyName","propertyOldValue","propertyNewValue","indexOf","cancelWatchesForObjects","clearInterval","milliseconds","setMilliseconds","getMilliseconds","isWatchDomIdAvailable","_public","cancelWatch","cancelWatches","getWatch","getWatches","pauseWatch","pauseWatches","resumeWatch","resumeWatches","searchDomForNewWatches","setConfiguration","configurationHasChanged","newInternalConfiguration","getVersion","addEventListener","window","$observe"],"mappings":"AAAA;;AAGA,IAAIA;;AACJ,CAAEC;IACAA,EAAUC,4BAA4B;AACvC,EAFD,CAEGF,aAAaA,WAAW,CAAC;;AAG5B,IAAIG;;AACJ,CAAEC;IACA,SAASC,EAAQC;QACf,OAAOA,MAAU,QAAQA,WAAe,KAAKA,EAAMC,eAAe;AACpE;IACAH,EAAIC,UAAUA;IACd,SAASG,EAAcC;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAII,gBAAgBA;IACpB,SAASE,EAAeD;QACtB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIM,iBAAiBA;IACrB,SAASC,EAAcF;QACrB,OAAOJ,EAAQI,aAAkBA,MAAW;AAC9C;IACAL,EAAIO,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IA,EAAiB4E,eAAeY,MAAiBrD,EAAeyC,eAAeY,MAAiBsB,EAAyBtB,OAAkBxF,EAAiBwF,IAAe;wBAC7KsB,EAAyBtB,KAAgBxF,EAAiBwF;wBAC1DqB,IAA0B;AAC5B;AACF;gBACA,IAAIA,GAAyB;oBAC3B1E,IAAiBxC,OAAOE,QAAQE,IAAI+G;AACtC;AACF;YACA,OAAOZ;AACT;QAMAa,YAAY;YACV,OAAO;AACT;;IAEF;QACE5E,IAAiBxC,OAAOE,QAAQE;QAChC4C,SAASqE,iBAAiB,qBAAoB,MAAM1E;QACpD2E,OAAOD,iBAAiB,aAAY;YAClC3E,IAAkB;YAClBuD;AAAyB;QAE3B,KAAKrJ,GAAGE,QAAQwK,OAAOC,WAAW;YAChCD,OAAOC,WAAWhB;AACpB;AACD,MAVD;AAWD,EAhWD","sourcesContent":[null]}
\ No newline at end of file
diff --git a/dist/observe.min.js b/dist/observe.min.js
index ca108ab..e0a0fca 100644
--- a/dist/observe.min.js
+++ b/dist/observe.min.js
@@ -1 +1 @@
-"use strict";var Constant,Is,Str,Default,Config,Watch,Trigger;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(Str||(Str={})).newGuid=function(){const e=[];for(let t=0;t<32;t++){8!==t&&12!==t&&16!==t&&20!==t||e.push("-");const n=Math.floor(16*Math.random()).toString(16);e.push(n)}return e.join("")},(e=>{function t(e,t){return Is.definedArray(e)?e:t}e.getAnyString=function(e,t){return"string"==typeof e?e:t},e.getString=function(e,t){return Is.definedString(e)?e:t},e.getBoolean=function(e,t){return Is.definedBoolean(e)?e:t},e.getNumber=function(e,t){return Is.definedNumber(e)?e:t},e.getFunction=function(e,t){return Is.definedFunction(e)?e:t},e.getArray=t,e.getObject=function(e,t){return Is.definedObject(e)?e:t},e.getDate=function(e,t){return Is.definedDate(e)?e:t},e.getStringOrArray=function(e,n){let r=n;if(Is.definedString(e)){const t=e.toString().split("space");0===t.length?e=n:r=t}else r=t(e,n);return r}})(Default||(Default={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default.getObject(e,{});return t.safeMode=Default.getBoolean(t.safeMode,!0),t.domElementTypes=Default.getStringOrArray(t.domElementTypes,["*"]),t=function(e){return e.text=Default.getObject(e.text,{}),e.text.objectErrorText=Default.getString(e.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),e.text.attributeNotValidErrorText=Default.getString(e.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),e.text.attributeNotSetErrorText=Default.getString(e.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),e}(t),t}})(Config||(Config={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e){let t=Default.getObject(e,{});return t.timeout=Default.getNumber(t.timeout,250),t.starts=Default.getDate(t.starts,null),t.expires=Default.getDate(t.expires,null),t.reset=Default.getBoolean(t.reset,!1),t.cancelOnChange=Default.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default.getArray(t.propertyNames,null),t.allowCanceling=Default.getBoolean(t.allowCanceling,!0),t.allowPausing=Default.getBoolean(t.allowPausing,!0),t.removeAttribute=Default.getBoolean(t.removeAttribute,!0),t=function(e){return e.events=Default.getObject(e.events,{}),e.events.onChange=Default.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default.getFunction(e.events.onCancel,null),e.events.onRemove=Default.getFunction(e.events.onRemove,null),e.events.onStart=Default.getFunction(e.events.onStart,null),e}(t),t}})(Watch||(Watch={})),(Trigger||(Trigger={})).customEvent=function(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))},(()=>{let _configuration={};const _watches={};let _watches_Cancel=!1;function collectDOMObjects(){const e=_configuration.domElementTypes,t=e.length;for(let n=0;n=e.starts)&&(watchObjectForChanges(t),Is.definedDate(e.expires)&&n>=e.expires&&cancelWatchObject(t))}function watchObjectForChanges(e){if(_watches.hasOwnProperty(e)){const t=_watches[e],n=Is.definedString(t.domElementId);let r=null;n&&(r=document.getElementById(t.domElementId),Is.defined(r)?t.originalObject=r.outerHTML:(t.originalObject="",Trigger.customEvent(t.options.events.onRemove,t.domElementId)));const o=t.cachedObject,c=t.originalObject,a=n?c:JSON.stringify(c);if(o!==a){if(t.options.reset?n?r.outerHTML=t.cachedObject:t.originalObject=getObjectFromString(o).object:t.cachedObject=a,n)Trigger.customEvent(t.options.events.onChange,o,a);else{const e=getObjectFromString(o).object,n=getObjectFromString(a).object;Is.definedArray(e)||Is.definedArray(n)?Trigger.customEvent(t.options.events.onChange,e,n):(compareWatchObject(e,n,t),Is.definedFunction(t.options.events.onPropertyChange)&&compareWatchObjectProperties(e,n,t))}t.totalChanges++,t.options.pauseTimeoutOnChange>0&&pauseWatchObject(e,t.options.pauseTimeoutOnChange),t.options.cancelOnChange&&cancelWatchObject(e),t.options.maximumChangesBeforeCanceling>0&&t.totalChanges>=t.options.maximumChangesBeforeCanceling&&cancelWatchObject(e)}}}function compareWatchObject(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o-1)&&JSON.stringify(o)!==JSON.stringify(c)&&Trigger.customEvent(n.options.events.onPropertyChange,r,o,c)}}function cancelWatchesForObjects(){for(let e in _watches)_watches.hasOwnProperty(e)&&cancelWatchObject(e)}function cancelWatchObject(e){if(_watches.hasOwnProperty(e)){const t=_watches[e].options;(t.allowCanceling||_watches_Cancel)&&(Trigger.customEvent(t.events.onCancel,e),clearInterval(_watches[e].timer),delete _watches[e])}}function pauseWatchObject(e,t){let n=!1;if(_watches.hasOwnProperty(e)){const r=_watches[e].options;r.allowPausing&&(r.starts=new Date,r.starts.setMilliseconds(r.starts.getMilliseconds()+t),n=!0)}return n}function getObjectFromString(objectString){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){_configuration.safeMode||(logError(_configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message)),result.parsed=!1),result.object=null}}return result}function logError(e){let t=!0;return _configuration.safeMode||(console.error(e),t=!1),t}const _public={watch:function(e,t){return createWatch(e,t)},cancelWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))cancelWatchObject(e),t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){cancelWatchObject(n),t=!0;break}return t},cancelWatches:function(){return cancelWatchesForObjects(),_public},getWatch:function(e){let t=null;if(Is.definedString(e))if(_watches.hasOwnProperty(e))t=_watches[e];else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){t=_watches[n];break}return t},getWatches:function(){return _watches},pauseWatch:function(e,t){let n=!1;if(Is.definedString(e)&&Is.definedNumber(t))if(_watches.hasOwnProperty(e))n=pauseWatchObject(e,t);else for(let r in _watches)if(_watches.hasOwnProperty(r)&&Is.definedString(_watches[r].domElementId)&&_watches[r].domElementId===e){n=pauseWatchObject(r,t);break}return n},pauseWatches:function(e){if(Is.definedNumber(e))for(let t in _watches)_watches.hasOwnProperty(t)&&pauseWatchObject(t,e);return _public},resumeWatch:function(e){let t=!1;if(Is.definedString(e))if(_watches.hasOwnProperty(e))_watches[e].options.starts=null,t=!0;else for(let n in _watches)if(_watches.hasOwnProperty(n)&&Is.definedString(_watches[n].domElementId)&&_watches[n].domElementId===e){_watches[n].options.starts=null,t=!0;break}return t},resumeWatches:function(){for(let e in _watches)_watches.hasOwnProperty(e)&&(_watches[e].options.starts=null);return _public},searchDomForNewWatches:function(){return collectDOMObjects(),_public},setConfiguration:function(e){if(Is.definedObject(e)){let t=!1;const n=_configuration;for(let r in e)e.hasOwnProperty(r)&&_configuration.hasOwnProperty(r)&&n[r]!==e[r]&&(n[r]=e[r],t=!0);t&&(_configuration=Config.Options.get(n))}return _public},getVersion:function(){return"1.0.1"}};_configuration=Config.Options.get(),document.addEventListener("DOMContentLoaded",(function(){collectDOMObjects()})),window.addEventListener("pagehide",(function(){_watches_Cancel=!0,cancelWatchesForObjects()})),Is.defined(window.$observe)||(window.$observe=_public)})();
\ No newline at end of file
+"use strict";var Constant,Is,Log,Default2,Config,Watch,Trigger;(Constant||(Constant={})).OBSERVE_JS_ATTRIBUTE_NAME="data-observe-js",(e=>{function t(e){return null!=e&&""!==e.toString()}function n(e){return t(e)&&"object"==typeof e}e.defined=t,e.definedObject=n,e.definedBoolean=function(e){return t(e)&&"boolean"==typeof e},e.definedString=function(e){return t(e)&&"string"==typeof e},e.definedFunction=function(e){return t(e)&&"function"==typeof e},e.definedNumber=function(e){return t(e)&&"number"==typeof e},e.definedArray=function(e){return n(e)&&e instanceof Array},e.definedDate=function(e){return n(e)&&e instanceof Date}})(Is||(Is={})),(Log||(Log={})).error=function(e,t){let n=!0;return t.safeMode||(console.error(e),n=!1),n},(Default=>{function getAnyString(e,t){return"string"==typeof e?e:t}function getString(e,t){return Is.definedString(e)?e:t}function getBoolean(e,t){return Is.definedBoolean(e)?e:t}function getNumber(e,t){return Is.definedNumber(e)?e:t}function getFunction(e,t){return Is.definedFunction(e)?e:t}function getArray(e,t){return Is.definedArray(e)?e:t}function getObject(e,t){return Is.definedObject(e)?e:t}function getDate(e,t){return Is.definedDate(e)?e:t}function getStringOrArray(e,t){let n=t;if(Is.definedString(e)){const r=e.toString().split("space");0===r.length?e=t:n=r}else n=getArray(e,t);return n}function getObjectFromString(objectString,configuration){const result={parsed:!0,object:null};try{Is.definedString(objectString)&&(result.object=JSON.parse(objectString))}catch(e1){try{result.object=eval(`(${objectString})`),Is.definedFunction(result.object)&&(result.object=result.object())}catch(e){configuration.safeMode||(Log.error(configuration.text.objectErrorText.replace("{{error_1}}",e1.message).replace("{{error_2}}",e.message),configuration),result.parsed=!1),result.object=null}}return result}Default.getAnyString=getAnyString,Default.getString=getString,Default.getBoolean=getBoolean,Default.getNumber=getNumber,Default.getFunction=getFunction,Default.getArray=getArray,Default.getObject=getObject,Default.getDate=getDate,Default.getStringOrArray=getStringOrArray,Default.getObjectFromString=getObjectFromString})(Default2||(Default2={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e=null){let t=Default2.getObject(e,{});return t.safeMode=Default2.getBoolean(t.safeMode,!0),t.domElementTypes=Default2.getStringOrArray(t.domElementTypes,["*"]),t=function(e){return e.text=Default2.getObject(e.text,{}),e.text.objectErrorText=Default2.getString(e.text.objectErrorText,"Errors in object: {{error_1}}, {{error_2}}"),e.text.attributeNotValidErrorText=Default2.getString(e.text.attributeNotValidErrorText,"The attribute '{{attribute_name}}' is not a valid object."),e.text.attributeNotSetErrorText=Default2.getString(e.text.attributeNotSetErrorText,"The attribute '{{attribute_name}}' has not been set correctly."),e}(t),t}})(Config||(Config={})),(e=>{let t;(t=e.Options||(e.Options={})).get=function(e){let t=Default2.getObject(e,{});return t.timeout=Default2.getNumber(t.timeout,250),t.starts=Default2.getDate(t.starts,null),t.expires=Default2.getDate(t.expires,null),t.reset=Default2.getBoolean(t.reset,!1),t.cancelOnChange=Default2.getBoolean(t.cancelOnChange,!1),t.maximumChangesBeforeCanceling=Default2.getNumber(t.maximumChangesBeforeCanceling,0),t.pauseTimeoutOnChange=Default2.getNumber(t.pauseTimeoutOnChange,0),t.propertyNames=Default2.getArray(t.propertyNames,null),t.allowCanceling=Default2.getBoolean(t.allowCanceling,!0),t.allowPausing=Default2.getBoolean(t.allowPausing,!0),t.removeAttribute=Default2.getBoolean(t.removeAttribute,!0),t=function(e){return e.events=Default2.getObject(e.events,{}),e.events.onChange=Default2.getFunction(e.events.onChange,null),e.events.onPropertyChange=Default2.getFunction(e.events.onPropertyChange,null),e.events.onCancel=Default2.getFunction(e.events.onCancel,null),e.events.onRemove=Default2.getFunction(e.events.onRemove,null),e.events.onStart=Default2.getFunction(e.events.onStart,null),e}(t),t}})(Watch||(Watch={})),(Trigger||(Trigger={})).customEvent=function(e,...t){Is.definedFunction(e)&&e.apply(null,[].slice.call(t,0))},(()=>{let e={};const t={};let n=!1;function r(){const t=e.domElementTypes,n=t.length;for(let e=0;e{!function(n,r){const o=new Date;(!Is.definedDate(n.starts)||o>=n.starts)&&(!function(n){if(t.hasOwnProperty(n)){const r=t[n],o=Is.definedString(r.domElementId);let i=null;o&&(i=document.getElementById(r.domElementId),Is.defined(i)?r.originalObject=i.outerHTML:(r.originalObject="",Trigger.customEvent(r.options.events.onRemove,r.domElementId)));const s=r.cachedObject,c=r.originalObject,f=o?c:JSON.stringify(c);if(s!==f){if(r.options.reset?o?i.outerHTML=r.cachedObject:r.originalObject=Default2.getObjectFromString(s,e).object:r.cachedObject=f,o)Trigger.customEvent(r.options.events.onChange,s,f);else{const t=Default2.getObjectFromString(s,e).object,n=Default2.getObjectFromString(f,e).object;Is.definedArray(t)||Is.definedArray(n)?Trigger.customEvent(r.options.events.onChange,t,n):(!function(e,t,n){if(Is.definedArray(n.options.propertyNames)){const r=n.options.propertyNames.length;for(let o=0;o0&&l(n,r.options.pauseTimeoutOnChange),r.options.cancelOnChange&&u(n),r.options.maximumChangesBeforeCanceling>0&&r.totalChanges>=r.options.maximumChangesBeforeCanceling&&u(n)}}}(r),Is.definedDate(n.expires)&&o>=n.expires&&u(r))}(s,i)}),s.timeout),t[i]=c)}return i}function a(e,t,n){for(let r in e)if(e.hasOwnProperty(r)){const o=e[r];let i=null;t.hasOwnProperty(r)&&(i=t[r]),Is.definedObject(o)&&Is.definedObject(i)?a(o,i,n):(!Is.definedArray(n.options.propertyNames)||n.options.propertyNames.indexOf(r)>-1)&&JSON.stringify(o)!==JSON.stringify(i)&&Trigger.customEvent(n.options.events.onPropertyChange,r,o,i)}}function s(){for(let e in t)t.hasOwnProperty(e)&&u(e)}function u(e){if(t.hasOwnProperty(e)){const r=t[e].options;(r.allowCanceling||n)&&(Trigger.customEvent(r.events.onCancel,e),clearInterval(t[e].timerId),delete t[e])}}function l(e,n){let r=!1;if(t.hasOwnProperty(e)){const o=t[e].options;o.allowPausing&&(o.starts=new Date,o.starts.setMilliseconds(o.starts.getMilliseconds()+n),r=!0)}return r}function c(e,n){return t.hasOwnProperty(e)&&Is.definedString(t[e].domElementId)&&t[e].domElementId===n}const f={watch:function(e,t){return i(e,t)},cancelWatch:function(e){let n=!1;if(Is.definedString(e))if(t.hasOwnProperty(e))u(e),n=!0;else for(let r in t)if(c(r,e)){u(r),n=!0;break}return n},cancelWatches:function(){return s(),f},getWatch:function(e){let n=null;if(Is.definedString(e))if(t.hasOwnProperty(e))n=t[e];else for(let r in t)if(c(r,e)){n=t[r];break}return n},getWatches:function(){return t},pauseWatch:function(e,n){let r=!1;if(Is.definedString(e)&&Is.definedNumber(n))if(t.hasOwnProperty(e))r=l(e,n);else for(let o in t)if(c(o,e)){r=l(o,n);break}return r},pauseWatches:function(e){if(Is.definedNumber(e))for(let n in t)t.hasOwnProperty(n)&&l(n,e);return f},resumeWatch:function(e){let n=!1;if(Is.definedString(e))if(t.hasOwnProperty(e))t[e].options.starts=null,n=!0;else for(let r in t)if(c(r,e)){t[r].options.starts=null,n=!0;break}return n},resumeWatches:function(){for(let e in t)t.hasOwnProperty(e)&&(t[e].options.starts=null);return f},searchDomForNewWatches:function(){return r(),f},setConfiguration:function(t){if(Is.definedObject(t)){let n=!1;const r=e;for(let o in t)t.hasOwnProperty(o)&&e.hasOwnProperty(o)&&r[o]!==t[o]&&(r[o]=t[o],n=!0);n&&(e=Config.Options.get(r))}return f},getVersion:function(){return"1.1.0"}};e=Config.Options.get(),document.addEventListener("DOMContentLoaded",(()=>r())),window.addEventListener("pagehide",(()=>{n=!0,s()})),Is.defined(window.$observe)||(window.$observe=f)})();
\ No newline at end of file
diff --git a/docs/CHANGE_LOG.md b/docs/CHANGE_LOG.md
index 4798f50..add9ac0 100644
--- a/docs/CHANGE_LOG.md
+++ b/docs/CHANGE_LOG.md
@@ -1,5 +1,21 @@
# Observe.js - Change Log:
+## Version 1.1.0:
+- Improved the HTML testing files.
+- Improved event assigning, and re-organized the code into separate files.
+- The GUIDs generated now used the "crypto.randomUUID()" instead of the custom-built one (this is now RFC4122-compliant).
+- Updated all the NPM packages to the latest versions.
+- Moved all event assignments to use lambdas.
+- Updates to the README files to make the features stand out.
+- Added an ignore path for ".DS_Store" files when packing the NuGet package.
+- Removed replicated conditions to check for DOM elements.
+- Internal renames to reflect the correct return types.
+
+
+
+
+#### **Language Shift:**
+
## Version 1.0.1:
- Updated to the latest NPM packages.
- Organized all of the .ts files into separate folders.
diff --git a/observe.js.nuspec b/observe.js.nuspec
index 67d8072..28d695c 100644
--- a/observe.js.nuspec
+++ b/observe.js.nuspec
@@ -2,7 +2,7 @@
jObserve.js
- 1.0.1
+ 1.1.0Observe.jsA lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.William Troup
@@ -15,6 +15,6 @@
William Troup
-
+
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 4b37448..1aee5b2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,19 +1,19 @@
{
"name": "jobserve.js",
- "version": "1.0.1",
+ "version": "1.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "jobserve.js",
- "version": "1.0.1",
+ "version": "1.1.0",
"license": "MIT",
"devDependencies": {
- "@swc/core": "^1.7.0",
- "sass": "^1.77.8",
- "terser": "^5.31.3",
- "tsup": "^8.2.2",
- "typescript": "^5.5.4"
+ "@swc/core": "^1.7.26",
+ "sass": "^1.78.0",
+ "terser": "^5.32.0",
+ "tsup": "^8.2.4",
+ "typescript": "^5.6.2"
}
},
"node_modules/@esbuild/aix-ppc64": {
@@ -780,15 +780,15 @@
]
},
"node_modules/@swc/core": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.0.tgz",
- "integrity": "sha512-d4vMzH6ICllDwlPuhset2h8gu/USHdbyfJim+2hQEdxC0UONtfpmu38XBgNqRjStrji1Q5M10jfeUZL3cu1i8g==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.7.26.tgz",
+ "integrity": "sha512-f5uYFf+TmMQyYIoxkn/evWhNGuUzC730dFwAKGwBVHHVoPyak1/GvJUm6i1SKl+2Hrj9oN0i3WSoWWZ4pgI8lw==",
"dev": true,
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@swc/counter": "^0.1.3",
- "@swc/types": "^0.1.9"
+ "@swc/types": "^0.1.12"
},
"engines": {
"node": ">=10"
@@ -798,16 +798,16 @@
"url": "https://opencollective.com/swc"
},
"optionalDependencies": {
- "@swc/core-darwin-arm64": "1.7.0",
- "@swc/core-darwin-x64": "1.7.0",
- "@swc/core-linux-arm-gnueabihf": "1.7.0",
- "@swc/core-linux-arm64-gnu": "1.7.0",
- "@swc/core-linux-arm64-musl": "1.7.0",
- "@swc/core-linux-x64-gnu": "1.7.0",
- "@swc/core-linux-x64-musl": "1.7.0",
- "@swc/core-win32-arm64-msvc": "1.7.0",
- "@swc/core-win32-ia32-msvc": "1.7.0",
- "@swc/core-win32-x64-msvc": "1.7.0"
+ "@swc/core-darwin-arm64": "1.7.26",
+ "@swc/core-darwin-x64": "1.7.26",
+ "@swc/core-linux-arm-gnueabihf": "1.7.26",
+ "@swc/core-linux-arm64-gnu": "1.7.26",
+ "@swc/core-linux-arm64-musl": "1.7.26",
+ "@swc/core-linux-x64-gnu": "1.7.26",
+ "@swc/core-linux-x64-musl": "1.7.26",
+ "@swc/core-win32-arm64-msvc": "1.7.26",
+ "@swc/core-win32-ia32-msvc": "1.7.26",
+ "@swc/core-win32-x64-msvc": "1.7.26"
},
"peerDependencies": {
"@swc/helpers": "*"
@@ -819,9 +819,9 @@
}
},
"node_modules/@swc/core-darwin-arm64": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.7.0.tgz",
- "integrity": "sha512-2ylhM7f0HwUwLrFYZAe/dse8PCbPsYcJS3Dt7Q8NT3PUn7vy6QOMxNcOPPuDrnmaXqQQO3oxdmRapguTxaat9g==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.7.26.tgz",
+ "integrity": "sha512-FF3CRYTg6a7ZVW4yT9mesxoVVZTrcSWtmZhxKCYJX9brH4CS/7PRPjAKNk6kzWgWuRoglP7hkjQcd6EpMcZEAw==",
"cpu": [
"arm64"
],
@@ -836,9 +836,9 @@
}
},
"node_modules/@swc/core-darwin-x64": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.7.0.tgz",
- "integrity": "sha512-SgVnN4gT1Rb9YfTkp4FCUITqSs7Yj0uB2SUciu5CV3HuGvS5YXCUzh+KrwpLFtx8NIgivISKcNnb41mJi98X8Q==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.7.26.tgz",
+ "integrity": "sha512-az3cibZdsay2HNKmc4bjf62QVukuiMRh5sfM5kHR/JMTrLyS6vSw7Ihs3UTkZjUxkLTT8ro54LI6sV6sUQUbLQ==",
"cpu": [
"x64"
],
@@ -853,9 +853,9 @@
}
},
"node_modules/@swc/core-linux-arm-gnueabihf": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.7.0.tgz",
- "integrity": "sha512-+Z9Dayart1iKJQEJJ9N/KS4z5EdXJE3WPFikY0jonKTo4Dd8RuyVz5yLvqcIMeVdz/SwximATaL6iJXw7hZS9A==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.7.26.tgz",
+ "integrity": "sha512-VYPFVJDO5zT5U3RpCdHE5v1gz4mmR8BfHecUZTmD2v1JeFY6fv9KArJUpjrHEEsjK/ucXkQFmJ0jaiWXmpOV9Q==",
"cpu": [
"arm"
],
@@ -870,9 +870,9 @@
}
},
"node_modules/@swc/core-linux-arm64-gnu": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.7.0.tgz",
- "integrity": "sha512-UnLrCiZ1EI4shznJn0xP6DLgsXUSwtfsdgHhGYCrvbgVBBve3S9iFgVFEB3SPl7Q/TdowNbrN4zHU0oChfiNfw==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.7.26.tgz",
+ "integrity": "sha512-YKevOV7abpjcAzXrhsl+W48Z9mZvgoVs2eP5nY+uoMAdP2b3GxC0Df1Co0I90o2lkzO4jYBpTMcZlmUXLdXn+Q==",
"cpu": [
"arm64"
],
@@ -887,9 +887,9 @@
}
},
"node_modules/@swc/core-linux-arm64-musl": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.7.0.tgz",
- "integrity": "sha512-H724UANA+ptsfwKRr9mnaDa9cb5fw0oFysiGKTgb3DMYcgk3Od0jMTnXVPFSVpo7FlmyxeC9K8ueUPBOoOK6XA==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.7.26.tgz",
+ "integrity": "sha512-3w8iZICMkQQON0uIcvz7+Q1MPOW6hJ4O5ETjA0LSP/tuKqx30hIniCGOgPDnv3UTMruLUnQbtBwVCZTBKR3Rkg==",
"cpu": [
"arm64"
],
@@ -904,9 +904,9 @@
}
},
"node_modules/@swc/core-linux-x64-gnu": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.0.tgz",
- "integrity": "sha512-SY3HA0K0Dpqt1HIfMLGpwL4hd4UaL2xHP5oZXPlRQPhUDZrbb4PbI3ZJnh66c63eL4ZR8EJ+HRFI0Alx5p69Zw==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.7.26.tgz",
+ "integrity": "sha512-c+pp9Zkk2lqb06bNGkR2Looxrs7FtGDMA4/aHjZcCqATgp348hOKH5WPvNLBl+yPrISuWjbKDVn3NgAvfvpH4w==",
"cpu": [
"x64"
],
@@ -921,9 +921,9 @@
}
},
"node_modules/@swc/core-linux-x64-musl": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.0.tgz",
- "integrity": "sha512-cEJ2ebtV1v/5Ilb55E05J6F5SrHKQWzUttIhR5Mkayyo+yvPslcpByuFC3D+J7X1ebziTOBpWuMpUdjLfh3SMQ==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.7.26.tgz",
+ "integrity": "sha512-PgtyfHBF6xG87dUSSdTJHwZ3/8vWZfNIXQV2GlwEpslrOkGqy+WaiiyE7Of7z9AvDILfBBBcJvJ/r8u980wAfQ==",
"cpu": [
"x64"
],
@@ -938,9 +938,9 @@
}
},
"node_modules/@swc/core-win32-arm64-msvc": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.7.0.tgz",
- "integrity": "sha512-ecQOOmzEssz+m0pR4xDYCGuvn3E/l0nQ3tk5jp1NA1lsAy4bMV0YbYCHjptYvWL/UjhIerIp3IlCJ8x5DodSog==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.7.26.tgz",
+ "integrity": "sha512-9TNXPIJqFynlAOrRD6tUQjMq7KApSklK3R/tXgIxc7Qx+lWu8hlDQ/kVPLpU7PWvMMwC/3hKBW+p5f+Tms1hmA==",
"cpu": [
"arm64"
],
@@ -955,9 +955,9 @@
}
},
"node_modules/@swc/core-win32-ia32-msvc": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.7.0.tgz",
- "integrity": "sha512-gz81seZkRn3zMnVOc7L5k6F4vQC82gIxmHiL+GedK+A37XI/X26AASU3zxvORnqQbwQYXQ+AEVckxBmFlz3v2g==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.7.26.tgz",
+ "integrity": "sha512-9YngxNcG3177GYdsTum4V98Re+TlCeJEP4kEwEg9EagT5s3YejYdKwVAkAsJszzkXuyRDdnHUpYbTrPG6FiXrQ==",
"cpu": [
"ia32"
],
@@ -972,9 +972,9 @@
}
},
"node_modules/@swc/core-win32-x64-msvc": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.7.0.tgz",
- "integrity": "sha512-b5Fd1xEOw9uqBpj2lqsaR4Iq9UhiL84hNDcEsi6DQA7Y1l85waQAslTbS0E4/pJ1PISAs0jW0zIGLco1eaWBOg==",
+ "version": "1.7.26",
+ "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.7.26.tgz",
+ "integrity": "sha512-VR+hzg9XqucgLjXxA13MtV5O3C0bK0ywtLIBw/+a+O+Oc6mxFWHtdUeXDbIi5AiPbn0fjgVJMqYnyjGyyX8u0w==",
"cpu": [
"x64"
],
@@ -996,9 +996,9 @@
"license": "Apache-2.0"
},
"node_modules/@swc/types": {
- "version": "0.1.9",
- "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.9.tgz",
- "integrity": "sha512-qKnCno++jzcJ4lM4NTfYifm1EFSCeIfKiAHAfkENZAV5Kl9PjJIyd2yeeVv6c/2CckuLyv2NmRC5pv6pm2WQBg==",
+ "version": "0.1.12",
+ "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.12.tgz",
+ "integrity": "sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
@@ -2051,9 +2051,9 @@
}
},
"node_modules/sass": {
- "version": "1.77.8",
- "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz",
- "integrity": "sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==",
+ "version": "1.78.0",
+ "resolved": "https://registry.npmjs.org/sass/-/sass-1.78.0.tgz",
+ "integrity": "sha512-AaIqGSrjo5lA2Yg7RvFZrlXDBCp3nV4XP73GrLGvdRWWwk+8H3l0SDvq/5bA4eF+0RFPLuWUk3E+P1U/YqnpsQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2290,9 +2290,9 @@
}
},
"node_modules/terser": {
- "version": "5.31.3",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz",
- "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==",
+ "version": "5.32.0",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.32.0.tgz",
+ "integrity": "sha512-v3Gtw3IzpBJ0ugkxEX8U0W6+TnPKRRCWGh1jC/iM/e3Ki5+qvO1L1EAZ56bZasc64aXHwRHNIQEzm6//i5cemQ==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
@@ -2379,9 +2379,9 @@
"license": "Apache-2.0"
},
"node_modules/tsup": {
- "version": "8.2.2",
- "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.2.2.tgz",
- "integrity": "sha512-MufIuzdSt6HYPOeOtjUXLR4rqRJySi6XsRNZdwvjC2XR+xghsu2L3vSmYmX+k4S1mO6j0OlUEyVQ3Fc0H66XcA==",
+ "version": "8.2.4",
+ "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.2.4.tgz",
+ "integrity": "sha512-akpCPePnBnC/CXgRrcy72ZSntgIEUa1jN0oJbbvpALWKNOz1B7aM+UVDWGRGIO/T/PZugAESWDJUAb5FD48o8Q==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2431,9 +2431,9 @@
}
},
"node_modules/typescript": {
- "version": "5.5.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz",
- "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==",
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz",
+ "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
diff --git a/package.json b/package.json
index fa855ad..2f61153 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "jobserve.js",
"title": "Observe.js",
"description": "A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.",
- "version": "1.0.1",
+ "version": "1.1.0",
"homepage": "https://www.william-troup.com/observe-js/",
"author": {
"name": "Bunoon"
@@ -43,10 +43,10 @@
"build-typescript-minimized": "tsup --config tsup.build.min.config.ts"
},
"devDependencies": {
- "@swc/core": "^1.7.0",
- "sass": "^1.77.8",
- "terser": "^5.31.3",
- "tsup": "^8.2.2",
- "typescript": "^5.5.4"
+ "@swc/core": "^1.7.26",
+ "sass": "^1.78.0",
+ "terser": "^5.32.0",
+ "tsup": "^8.2.4",
+ "typescript": "^5.6.2"
}
}
diff --git a/src/observe.ts b/src/observe.ts
index 3832930..ec89fa7 100644
--- a/src/observe.ts
+++ b/src/observe.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file observe.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
@@ -14,22 +14,18 @@
import {
type WatchOptions,
type Configuration,
- type ObserveWatch } from "./ts/type";
+ type ObserveWatch,
+ type StringToJson } from "./ts/type";
import { type PublicApi } from "./ts/api";
import { Constant } from "./ts/constant";
import { Char } from "./ts/data/enum";
import { Is } from "./ts/data/is";
-import { Str } from "./ts/data/str";
import { Config } from "./ts/options/config";
import { Watch } from "./ts/options/watch";
import { Trigger } from "./ts/area/trigger";
-
-
-type StringToJson = {
- parsed: boolean;
- object: any;
-};
+import { Default } from "./ts/data/default";
+import { Log } from "./ts/area/log";
( () => {
@@ -71,13 +67,13 @@ type StringToJson = {
const bindingOptionsData: string = element.getAttribute( Constant.OBSERVE_JS_ATTRIBUTE_NAME )!;
if ( Is.definedString( bindingOptionsData ) ) {
- const watchOptionsJson: StringToJson = getObjectFromString( bindingOptionsData );
+ const watchOptionsJson: StringToJson = Default.getObjectFromString( bindingOptionsData, _configuration );
if ( watchOptionsJson.parsed && Is.definedObject( watchOptionsJson.object ) ) {
const watchOptions: WatchOptions = Watch.Options.get( watchOptionsJson.object );
if ( !Is.definedString( element.id ) ) {
- element.id = Str.newGuid();
+ element.id = crypto.randomUUID();
}
if ( watchOptions.removeAttribute ) {
@@ -87,12 +83,12 @@ type StringToJson = {
createWatch( element, watchOptions, element.id );
} else {
- logError( _configuration.text!.attributeNotValidErrorText!.replace( "{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );
+ Log.error( _configuration.text!.attributeNotValidErrorText!.replace( "{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME ), _configuration );
result = false;
}
} else {
- logError( _configuration.text!.attributeNotSetErrorText!.replace( "{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME ) );
+ Log.error( _configuration.text!.attributeNotSetErrorText!.replace( "{{attribute_name}}", Constant.OBSERVE_JS_ATTRIBUTE_NAME ), _configuration );
result = false;
}
}
@@ -111,7 +107,7 @@ type StringToJson = {
let storageId: string = null!;
if ( Is.definedObject( object ) ) {
- storageId = Str.newGuid();
+ storageId = crypto.randomUUID();
const watchOptions: WatchOptions = Watch.Options.get( options );
const watch: ObserveWatch = {} as ObserveWatch;
@@ -141,7 +137,7 @@ type StringToJson = {
if ( Is.defined( watch.cachedObject ) ) {
Trigger.customEvent( watch.options.events!.onStart!, startWatchObject );
- watch.timer = setInterval( function() {
+ watch.timerId = setInterval( () => {
watchTimer( watchOptions, storageId );
}, watchOptions.timeout );
@@ -191,7 +187,7 @@ type StringToJson = {
if ( isDomElement ) {
domElement.outerHTML = watch.cachedObject;
} else {
- watch.originalObject = getObjectFromString( cachedObject ).object;
+ watch.originalObject = Default.getObjectFromString( cachedObject, _configuration ).object;
}
} else {
@@ -202,8 +198,8 @@ type StringToJson = {
Trigger.customEvent( watch.options.events!.onChange!, cachedObject, originalObjectJson );
} else {
- const oldValue: any = getObjectFromString( cachedObject ).object;
- const newValue: any = getObjectFromString( originalObjectJson ).object;
+ const oldValue: any = Default.getObjectFromString( cachedObject, _configuration ).object;
+ const newValue: any = Default.getObjectFromString( originalObjectJson, _configuration ).object;
if ( !Is.definedArray( oldValue ) && !Is.definedArray( newValue ) ) {
compareWatchObject( oldValue, newValue, watch );
@@ -290,7 +286,7 @@ type StringToJson = {
if ( watchOptions.allowCanceling || _watches_Cancel ) {
Trigger.customEvent( watchOptions.events!.onCancel!, storageId );
- clearInterval( _watches[ storageId ].timer );
+ clearInterval( _watches[ storageId ].timerId );
delete _watches[ storageId ];
}
@@ -314,54 +310,8 @@ type StringToJson = {
return result;
}
-
- /*
- * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- * Default Parameter/Option Handling
- * ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- */
-
- function getObjectFromString( objectString: any ) : StringToJson {
- const result: StringToJson = {
- parsed: true,
- object: null
- } as StringToJson;
-
- try {
- if ( Is.definedString( objectString ) ) {
- result.object = JSON.parse( objectString );
- }
-
- } catch ( e1: any ) {
- try {
- result.object = eval( `(${objectString})` );
-
- if ( Is.definedFunction( result.object ) ) {
- result.object = result.object();
- }
-
- } catch ( e2: any ) {
- if ( !_configuration.safeMode ) {
- logError( _configuration.text!.objectErrorText!.replace( "{{error_1}}", e1.message ).replace( "{{error_2}}", e2.message ) );
- result.parsed = false;
- }
-
- result.object = null;
- }
- }
-
- return result;
- }
-
- function logError( error: string ) : boolean {
- let result: boolean = true;
-
- if ( !_configuration.safeMode ) {
- console.error( error );
- result = false;
- }
-
- return result;
+ function isWatchDomIdAvailable( storageId: string, domElementId: string ) : boolean {
+ return _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === domElementId;
}
@@ -393,7 +343,7 @@ type StringToJson = {
} else {
for ( let storageId in _watches ) {
- if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {
+ if ( isWatchDomIdAvailable( storageId, id ) ) {
cancelWatchObject( storageId );
result = true;
@@ -421,7 +371,7 @@ type StringToJson = {
} else {
for ( let storageId in _watches ) {
- if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {
+ if ( isWatchDomIdAvailable( storageId, id ) ) {
result = _watches[ storageId ];
break;
}
@@ -445,7 +395,7 @@ type StringToJson = {
} else {
for ( let storageId in _watches ) {
- if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {
+ if ( isWatchDomIdAvailable( storageId, id ) ) {
result = pauseWatchObject( storageId, milliseconds );
break;
}
@@ -478,7 +428,7 @@ type StringToJson = {
} else {
for ( let storageId in _watches ) {
- if ( _watches.hasOwnProperty( storageId ) && Is.definedString( _watches[ storageId ].domElementId ) && _watches[ storageId ].domElementId === id ) {
+ if ( isWatchDomIdAvailable( storageId, id ) ) {
_watches[ storageId ].options.starts = null!;
result = true;
break;
@@ -541,7 +491,7 @@ type StringToJson = {
*/
getVersion: function () : string {
- return "1.0.1";
+ return "1.1.0";
}
};
@@ -555,11 +505,9 @@ type StringToJson = {
( () => {
_configuration = Config.Options.get();
- document.addEventListener( "DOMContentLoaded", function() {
- collectDOMObjects();
- } );
+ document.addEventListener( "DOMContentLoaded", () => collectDOMObjects() );
- window.addEventListener( "pagehide", function() {
+ window.addEventListener( "pagehide", () => {
_watches_Cancel = true;
cancelWatchesForObjects();
diff --git a/src/ts/api.ts b/src/ts/api.ts
index 7b11c15..ae8749b 100644
--- a/src/ts/api.ts
+++ b/src/ts/api.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file api.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/area/log.ts b/src/ts/area/log.ts
new file mode 100644
index 0000000..3a36719
--- /dev/null
+++ b/src/ts/area/log.ts
@@ -0,0 +1,28 @@
+/**
+ * Observe.js
+ *
+ * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
+ *
+ * @file log.ts
+ * @version v1.1.0
+ * @author Bunoon
+ * @license MIT License
+ * @copyright Bunoon 2024
+ */
+
+
+import { type Configuration } from "../type";
+
+
+export namespace Log {
+ export function error( error: string, configuration: Configuration ) : boolean {
+ let result: boolean = true;
+
+ if ( !configuration.safeMode ) {
+ console.error( error );
+ result = false;
+ }
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/src/ts/area/trigger.ts b/src/ts/area/trigger.ts
index 647e617..2eda0ae 100644
--- a/src/ts/area/trigger.ts
+++ b/src/ts/area/trigger.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file trigger.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/constant.ts b/src/ts/constant.ts
index c3974c4..b1f362f 100644
--- a/src/ts/constant.ts
+++ b/src/ts/constant.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file constant.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/data/default.ts b/src/ts/data/default.ts
index d636ba7..e9408f6 100644
--- a/src/ts/data/default.ts
+++ b/src/ts/data/default.ts
@@ -4,13 +4,15 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file default.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
*/
+import { type Configuration, type StringToJson } from "../type";
+import { Log } from "../area/log";
import { Char } from "./enum";
import { Is } from "./is";
@@ -66,4 +68,36 @@ export namespace Default {
return result;
}
+
+ export function getObjectFromString( objectString: any, configuration: Configuration ) : StringToJson {
+ const result: StringToJson = {
+ parsed: true,
+ object: null
+ } as StringToJson;
+
+ try {
+ if ( Is.definedString( objectString ) ) {
+ result.object = JSON.parse( objectString );
+ }
+
+ } catch ( e1: any ) {
+ try {
+ result.object = eval( `(${objectString})` );
+
+ if ( Is.definedFunction( result.object ) ) {
+ result.object = result.object();configuration
+ }
+
+ } catch ( e2: any ) {
+ if ( !configuration.safeMode ) {
+ Log.error( configuration.text!.objectErrorText!.replace( "{{error_1}}", e1.message ).replace( "{{error_2}}", e2.message ), configuration );
+ result.parsed = false;
+ }
+
+ result.object = null;
+ }
+ }
+
+ return result;
+ }
}
\ No newline at end of file
diff --git a/src/ts/data/enum.ts b/src/ts/data/enum.ts
index 9b4b41a..664352b 100644
--- a/src/ts/data/enum.ts
+++ b/src/ts/data/enum.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file enum.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/data/is.ts b/src/ts/data/is.ts
index 1d8b270..4ba48af 100644
--- a/src/ts/data/is.ts
+++ b/src/ts/data/is.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file is.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/data/str.ts b/src/ts/data/str.ts
deleted file mode 100644
index eac7ad3..0000000
--- a/src/ts/data/str.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Observe.js
- *
- * A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
- *
- * @file str.ts
- * @version v1.0.1
- * @author Bunoon
- * @license MIT License
- * @copyright Bunoon 2024
- */
-
-
-import { Char } from "./enum";
-
-
-export namespace Str {
- export function newGuid() : string {
- const result: string[] = [];
-
- for ( let charIndex: number = 0; charIndex < 32; charIndex++ ) {
- if ( charIndex === 8 || charIndex === 12 || charIndex === 16 || charIndex === 20 ) {
- result.push( Char.dash );
- }
-
- const character: string = Math.floor( Math.random() * 16 ).toString( 16 );
- result.push( character );
- }
-
- return result.join( Char.empty );
- }
-}
\ No newline at end of file
diff --git a/src/ts/options/config.ts b/src/ts/options/config.ts
index e1da82a..9101afc 100644
--- a/src/ts/options/config.ts
+++ b/src/ts/options/config.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file config.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/options/watch.ts b/src/ts/options/watch.ts
index 24d3977..c094640 100644
--- a/src/ts/options/watch.ts
+++ b/src/ts/options/watch.ts
@@ -4,7 +4,7 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file watch.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
diff --git a/src/ts/type.ts b/src/ts/type.ts
index 6ed30e2..85d2956 100644
--- a/src/ts/type.ts
+++ b/src/ts/type.ts
@@ -4,13 +4,18 @@
* A lightweight JavaScript library that allows developers to keep track of changes to JavaScript objects and/or DOM elements.
*
* @file type.ts
- * @version v1.0.1
+ * @version v1.1.0
* @author Bunoon
* @license MIT License
* @copyright Bunoon 2024
*/
+export type StringToJson = {
+ parsed: boolean;
+ object: any;
+};
+
export type Configuration = {
safeMode?: boolean;
domElementTypes?: string[] | string;
@@ -52,5 +57,5 @@ export type ObserveWatch = {
domElementId: string;
cachedObject: any;
originalObject: any;
- timer: number;
+ timerId: number;
};
\ No newline at end of file
diff --git a/test/observe.js.basic.html b/test/observe.js.basic.html
index ca9d252..b69b6bc 100644
--- a/test/observe.js.basic.html
+++ b/test/observe.js.basic.html
@@ -1,10 +1,11 @@
-
-
+
+
Observe.js - Basic
-
+
+
@@ -26,62 +27,62 @@