+`,
+ width : 320,
+ modal : true,
+ collapsible: false,
+ resizable: false,
+ buttons : [{
+ text : 'Close',
+ cmd : 'dialog-close'
+ }
+ ]
+});
+
+flipmousevent = (e) => {
+ if(e.isTrusted) {
+ e.stopImmediatePropagation();
+ w = e.target.clientWidth;
+ f = new MouseEvent(e.type, {
+ x: w-e.x,
+ y: e.y,
+ clientX: w-e.clientX,
+ clientY: e.clientY,
+ movementX: e.movementX*-1,
+ movementY: e.movementY,
+ button: e.button,
+ buttons: e.buttons,
+ screenX: e.screenX,
+ screenY: e.screenY,
+ bubbles: e.bubbles,
+ altKey: e.altKey,
+ ctrlKey: e.ctrlKey,
+ metaKey: e.metaKey,
+ shiftKey: e.shiftKey
+ });
+ e.target.dispatchEvent(f);
+ }
+}
\ No newline at end of file
diff --git a/extension/manifest.json b/extension/manifest.json
new file mode 100644
index 0000000..1e8ebcf
--- /dev/null
+++ b/extension/manifest.json
@@ -0,0 +1,10 @@
+{
+ "name": "ToggleView",
+ "description": "Allows you to switch the PCB View between Top and Bottom View.",
+ "version": "1.0",
+ "homepage": "https://github.com/xsrf/easyeda-toggleview",
+ "icons": {
+ "default": "icon.svg"
+ },
+ "scripts": [ "main.js" ]
+}
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..d9e1901
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,15 @@
+EasyEDA ToggleView Extension
+============================
+Download this code, open [EasyEDA](https://easyeda.com/editor), go to "Advanced" > "Extensions" > "Extensions Settings ..." > "Load Extension..." > "Select Files ..." > Select all files from the "extension" directory > "Load Extension".
+
+A "ToggleView" Menu should appear in the main menu in PCB view.
+
+Known Issues
+------------
+The X ruler is not flipped correctly
+
+How does it work?
+-----------------
+This is just a hacky workaround until EasyEDA implements it correctly.
+It basically applies the style `transform: scaleX(-1)` to the editor to flip it in X direction.
+To still be able to interact (click) with the flipped view with your mouse correctly, all mouse events also need to be catched and flipped in x direction.
\ No newline at end of file