Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Jul 26, 2023
1 parent 30bbd36 commit 10d19e5
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 70 deletions.
42 changes: 21 additions & 21 deletions addon/chrome/content/bubbleMap.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<body>
<script src="chrome://__addonRef__/content/lib/js/go.js"></script>
Expand Down Expand Up @@ -81,11 +81,11 @@
contentAlignment: go.Spot.Center, // align document to the center of the viewport
layout: $(
ContinuousForceDirectedLayout, // automatically spread nodes apart while dragging
{ defaultSpringLength: 15, defaultElectricalCharge: 30 }
{ defaultSpringLength: 15, defaultElectricalCharge: 30 },
),
// do an extra layout at the end of a move
SelectionMoved: (e) => e.diagram.layout.invalidateLayout(),
}
},
);

// dragging a node invalidates the Diagram.layout, causing a layout during the drag
Expand Down Expand Up @@ -114,9 +114,9 @@
desiredSize: new go.Size(10, 10),
},
new go.Binding("fill", "isSelected", (s, obj) =>
s ? "#f2ac46" : "lightgray"
).ofObject()
)
s ? "#f2ac46" : "lightgray",
).ofObject(),
),
),
$(
go.TextBlock,
Expand All @@ -127,8 +127,8 @@
textEdited: editNode,
},
new go.Binding("text", "text").makeTwoWay(),
new go.Binding("stroke", "stroke")
)
new go.Binding("stroke", "stroke"),
),
);
// the rest of this app is the same as samples/conceptMap.html

Expand All @@ -141,7 +141,7 @@
"Auto",
// this Adornment has a rectangular blue Shape around the selected node
$(go.Shape, { fill: null, stroke: "dodgerblue", strokeWidth: 3 }),
$(go.Placeholder, { margin: new go.Margin(4, 4, 0, 4) })
$(go.Placeholder, { margin: new go.Margin(4, 4, 0, 4) }),
),
// and this Adornment has a Button to the right of the selected node
$(
Expand All @@ -154,23 +154,23 @@
$(
go.TextBlock,
"↗️", // the Button content
{ font: "bold 8pt sans-serif" }
)
)
{ font: "bold 8pt sans-serif" },
),
),
);

// replace the default Link template in the linkTemplateMap
Diagram.linkTemplate = $(
go.Link, // the whole link panel
$(
go.Shape, // the link shape
{ stroke: "grey" }
{ stroke: "grey" },
),
$(
go.Shape, // the arrowhead
{ toArrow: "standard", stroke: null }
{ toArrow: "standard", stroke: null },
),
$(go.Panel, "Auto")
$(go.Panel, "Auto"),
);
window.parent.postMessage({ type: "ready" }, "*");
getData();
Expand All @@ -197,7 +197,7 @@
nodeDataArray.push({
key: node.model.id,
text: `${node.model.level === 7 ? "🔗" : ""}${wrapText(
node.model.name
node.model.name,
)}`,
stroke: "-moz-DialogText",
lineIndex: node.model.lineIndex,
Expand All @@ -221,7 +221,7 @@
if (olddata.noteLink) {
window.parent.postMessage(
{ type: "openNote", link: olddata.noteLink, id: olddata.key },
"*"
"*",
);
} else {
window.parent.postMessage(
Expand All @@ -231,7 +231,7 @@
id: olddata.key,
workspaceType: window.workspaceType || "tab",
},
"*"
"*",
);
}
}
Expand All @@ -250,7 +250,7 @@
text: data.text,
workspaceType: window.workspaceType || "tab",
},
"*"
"*",
);
}

Expand All @@ -270,7 +270,7 @@
type: "saveImageReturn",
image: imgString,
},
"*"
"*",
);
case "saveSVG":
const svgElement = Diagram.makeSvg({
Expand All @@ -281,7 +281,7 @@
type: "saveSVGReturn",
image: svgElement.outerHTML,
},
"*"
"*",
);
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions addon/chrome/content/imageViewer.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>Image Preview</title>
<meta charset="utf-8">
<meta charset="utf-8" />
</head>
<body>
<style>
Expand Down
36 changes: 18 additions & 18 deletions addon/chrome/content/mindMap.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<body>
<script src="chrome://__addonRef__/content/lib/js/go.js"></script>
Expand Down Expand Up @@ -56,7 +56,7 @@
new go.Binding("text", "text").makeTwoWay(),
new go.Binding("scale", "scale").makeTwoWay(),
new go.Binding("font", "font").makeTwoWay(),
new go.Binding("stroke", "stroke").makeTwoWay()
new go.Binding("stroke", "stroke").makeTwoWay(),
),
$(
go.Shape,
Expand All @@ -73,16 +73,16 @@
new go.Binding("stroke", "brush"),
// make sure links come in from the proper direction and go out appropriately
new go.Binding("fromSpot", "dir", (d) => spotConverter(d, true)),
new go.Binding("toSpot", "dir", (d) => spotConverter(d, false))
new go.Binding("toSpot", "dir", (d) => spotConverter(d, false)),
),
// remember the locations of each node in the node data
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(
go.Point.stringify
go.Point.stringify,
),
// make sure text "grows" in the desired direction
new go.Binding("locationSpot", "dir", (d) =>
spotConverter(d, false)
)
spotConverter(d, false),
),
);

// selected nodes show a button for adding children
Expand All @@ -94,7 +94,7 @@
"Auto",
// this Adornment has a rectangular blue Shape around the selected node
$(go.Shape, { fill: null, stroke: "dodgerblue", strokeWidth: 3 }),
$(go.Placeholder, { margin: new go.Margin(4, 4, 0, 4) })
$(go.Placeholder, { margin: new go.Margin(4, 4, 0, 4) }),
),
// and this Adornment has a Button to the right of the selected node
$(
Expand All @@ -107,9 +107,9 @@
$(
go.TextBlock,
"↗️", // the Button content
{ font: "bold 8pt sans-serif" }
)
)
{ font: "bold 8pt sans-serif" },
),
),
);

// a link is just a Bezier-curved line of the same color as the node to which it is connected
Expand All @@ -127,8 +127,8 @@
new go.Binding("stroke", "toNode", (n) => {
if (n.data.brush) return n.data.brush;
return "black";
}).ofObject()
)
}).ofObject(),
),
);

Diagram.addDiagramListener("SelectionMoved", (e) => {
Expand Down Expand Up @@ -263,7 +263,7 @@
data.nodeDataArray.push({
key: node.model.id,
text: `${node.model.level === 7 ? "🔗" : ""}${wrapText(
node.model.name
node.model.name,
)}`,
stroke: "-moz-DialogText",
parent: parent,
Expand All @@ -283,7 +283,7 @@
if (olddata.noteLink) {
window.parent.postMessage(
{ type: "openNote", link: olddata.noteLink, id: olddata.key },
"*"
"*",
);
} else {
window.parent.postMessage(
Expand All @@ -293,7 +293,7 @@
id: olddata.key,
workspaceType: window.workspaceType || "tab",
},
"*"
"*",
);
}
}
Expand All @@ -312,7 +312,7 @@
text: data.text,
workspaceType: window.workspaceType || "tab",
},
"*"
"*",
);
}

Expand All @@ -332,7 +332,7 @@
type: "saveImageReturn",
image: imgString,
},
"*"
"*",
);
case "saveSVG":
const svgElement = Diagram.makeSvg({
Expand All @@ -343,7 +343,7 @@
type: "saveSVGReturn",
image: svgElement.outerHTML,
},
"*"
"*",
);
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion addon/chrome/content/pdfPrinter.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
Expand Down
12 changes: 6 additions & 6 deletions addon/chrome/content/syncDiff.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<body>
<script src="chrome://__addonRef__/content/lib/js/jquery.min.js"></script>
Expand Down Expand Up @@ -278,7 +278,7 @@ <h2 style="margin: 0">Diff-Merger</h2>
store: new DevExpress.data.ArrayStore({
key: "id",
data: window.diffData.filter(
(diff) => diff.added || diff.removed
(diff) => diff.added || diff.removed,
),
}),
}),
Expand All @@ -292,7 +292,7 @@ <h2 style="margin: 0">Diff-Merger</h2>
? "added-list-item"
: e.itemData.removed
? "removed-list-item"
: ""
: "",
);
}
},
Expand All @@ -310,7 +310,7 @@ <h2 style="margin: 0">Diff-Merger</h2>
const diffViewer = document.querySelector(".diff-viewport");
diffViewer.scrollTo(
0,
target.offsetTop - diffViewer.offsetTop
target.offsetTop - diffViewer.offsetTop,
);
}
},
Expand Down Expand Up @@ -364,7 +364,7 @@ <h2 style="margin: 0">Diff-Merger</h2>
const syncScroller = function () {
let nodes = Array.prototype.filter.call(
arguments,
(item) => item instanceof HTMLElement
(item) => item instanceof HTMLElement,
);
let max = nodes.length;
if (!max || max === 1) return;
Expand All @@ -381,7 +381,7 @@ <h2 style="margin: 0">Diff-Merger</h2>
if (node == this) continue;
node.scrollTo(
left * (node.scrollWidth - node.clientWidth),
top * (node.scrollHeight - node.clientHeight)
top * (node.scrollHeight - node.clientHeight),
);
}
} else --sign;
Expand Down
14 changes: 10 additions & 4 deletions addon/chrome/content/syncManager.xhtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<?xml version="1.0"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://zotero-platform/content/zotero-react-client.css" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://zotero-platform/content/zotero.css" type="text/css"?>
<!-- prettier-ignore -->
<?xml-stylesheet href="chrome://__addonRef__/content/virtualizedTable.css" type="text/css"?>
<!-- prettier-ignore -->
<!DOCTYPE html>
<html
lang="en"
Expand All @@ -16,22 +22,22 @@
persist="screenX screenY width height sizemode"
>
<head>
<title locale-target="innerHTML">syncManager.title</title>
<title data-l10n-id="title"></title>
<meta charset="utf-8" />
<script>
document.addEventListener("DOMContentLoaded", (ev) => {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
"resource://gre/modules/Services.jsm",
);

Services.scriptloader.loadSubScript(
"chrome://zotero/content/include.js",
this
this,
);

Services.scriptloader.loadSubScript(
"resource://zotero/require.js",
this
this,
);
window.arguments[0]._initPromise.resolve();
});
Expand Down
Loading

0 comments on commit 10d19e5

Please sign in to comment.