Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions static/extensions/DogeisCut/dogeiscutObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@
return new ObjectType({ value: x })
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
// not sure how i feel about this
return this.toVisualContent().outerHTML
if (expectsPlainString) return this.toString()
else return this.toVisualContent().outerHTML
}

dogeiscutObjectHandler() {
return this.toString()
dogeiscutObjectHandler(expectsPlainString, context) {
if (expectsPlainString) return this.toString()
else return this.toVisualContent().outerHTML
}

static convertIfNeeded(x) {
Expand All @@ -122,10 +124,10 @@
}
if (obj !== null && typeof obj === "object") {
if (typeof obj.dogeiscutObjectHandler == "function") {
return obj.dogeiscutObjectHandler()
return obj.dogeiscutObjectHandler(true, "string")
}
if (typeof obj.jwArrayHandler == "function") {
return obj.jwArrayHandler()
return obj.jwArrayHandler(true, "string")
}
const entries = Object.entries(obj)
.map(([key, value]) => `"${key.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}":${stringify(value)}`)
Expand Down Expand Up @@ -178,9 +180,9 @@
} else if (RENDER_ARRAYS_VISUALLY && (isArray(value) || (jwArray && value instanceof jwArray.Type))) {
valueCell.appendChild(renderArray(isArray(value) ? value : (value.array || [])));
} else if (typeof value.dogeiscutObjectHandler === "function") {
valueCell.innerHTML = value.dogeiscutObjectHandler();
valueCell.innerHTML = value.dogeiscutObjectHandler(false, "object");
} else if (typeof value.jwArrayHandler === "function") {
valueCell.innerHTML = value.jwArrayHandler();
valueCell.innerHTML = value.jwArrayHandler(false, "object");
} else {
valueCell.appendChild(renderObject(value));
}
Expand Down Expand Up @@ -247,9 +249,9 @@
} else if (RENDER_ARRAYS_VISUALLY && (isArray(item) || (jwArray && item instanceof jwArray.Type))) {
valCell.appendChild(renderArray(isArray(item) ? item : (item.array || [])));
} else if (typeof item.dogeiscutObjectHandler === "function") {
valCell.innerHTML = item.dogeiscutObjectHandler();
valCell.innerHTML = item.dogeiscutObjectHandler(false, "array");
} else if (typeof item.jwArrayHandler === "function") {
valCell.innerHTML = item.jwArrayHandler();
valCell.innerHTML = item.jwArrayHandler(false, "array");
} else {
valCell.appendChild(renderObject(item));
}
Expand Down
12 changes: 8 additions & 4 deletions static/extensions/DogeisCut/dogeiscutSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
case "object":
if (x === null) return "null"
if (typeof x.jwArrayHandler == "function") {
return x.jwArrayHandler()
return x.jwArrayHandler(false, "set")
}
if (typeof x.dogeiscutSetHandler == "function") {
return x.dogeiscutSetHandler()
return x.dogeiscutSetHandler(false, "set")
}
return "Object"
case "undefined":
Expand All @@ -103,11 +103,15 @@
return "?"
}

dogeiscutSetHandler() {
dogeiscutSetHandler(expectsPlainString, context) {
return `Set<${formatNumber(this.set.size)}>`
}

dogeiscutObjectHandler(expectsPlainString, context) {
return `Set<${formatNumber(this.set.size)}>`
}

jwArrayHandler() {
jwArrayHandler(expectsPlainString, context) {
return `Set<${formatNumber(this.set.size)}>`
}

Expand Down
4 changes: 3 additions & 1 deletion static/extensions/Fruits555000/PaintUtils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions static/extensions/ddededodediamante/dateFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@
return `${y}-${m}-${d} ${hh}:${mm}`;
}

jwArrayHandler() {
return this.isValid() ? this._prettyShort() : "Invalid Date";
jwArrayHandler(expectsPlainString, context) {
return this.isValid() ? this._prettyShort() : "Invalid Date"; // always a string anyway
}

dogeiscutObjectHandler() {
return this.toListItem();

dogeiscutObjectHandler(expectsPlainString, context) {
if (expectsPlainString) return this.toString();
else return this.toListItem();
}
}

Expand Down
11 changes: 6 additions & 5 deletions static/extensions/ddededodediamante/dateFormatV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@
return `${y}-${m}-${d} ${hh}:${mm}`;
}

jwArrayHandler() {
return this.isValid() ? this._prettyShort() : "Invalid Date";
jwArrayHandler(expectsPlainString, context) {
return this.isValid() ? this._prettyShort() : "Invalid Date"; // always a string anyway
}

dogeiscutObjectHandler() {
return this.toListItem();

dogeiscutObjectHandler(expectsPlainString, context) {
if (expectsPlainString) return this.toString();
else return this.toListItem();
}
}

Expand Down