Ditch Inkscape.
[mlpccg.git] / mlpccg.js
index 0e8643e..87e8ac3 100644 (file)
--- a/mlpccg.js
+++ b/mlpccg.js
@@ -18,6 +18,7 @@ var THEMES = [
     "cadance",
     "celestia",
     "chrysalis",
+    "cmc",
     "dash",
     "discord",
     "fluttershy",
@@ -170,7 +171,8 @@ window.addEventListener('DOMContentLoaded', function () {
         }
     }
 
-    FastClick.attach(document.body, { tapDelay: 50 });
+    if (typeof FastClick !== "undefined")
+        FastClick.attach(document.body, { tapDelay: 50 });
     loadTheme();
 });
 
@@ -236,21 +238,14 @@ if (applicationCache && applicationCache.status) {
 }
 
 function dismiss () {
-    var overlay = document.getElementById("overlay");
-    if (overlay)
-        overlay.parentNode.removeChild(overlay);
-    broadcast({ type: "dismiss" });
+    var open = document.querySelectorAll(".dialog.open");
+    for (var i = 0; i < open.length; ++i)
+        open[i].className = "dialog";
 }
 
 function show (id) {
-    var overlay = document.getElementById("overlay");
-    if (!overlay) {
-        overlay = document.createElement('div');
-        overlay.id = 'overlay';
-    } else {
-        overlay.parentNode.removeChild(overlay);
-    }
+    dismiss();
     var target = document.getElementById(id);
-    target.parentNode.insertBefore(overlay, target);
+    target.className += " open";
 }