Browse code

handler spoiler tag

devnewton authored on 14/05/2017 10:02:40
Showing 3 changed files
... ...
@@ -85,6 +85,20 @@ figure:hover img {
85 85
 	top: 100%;
86 86
 }
87 87
 
88
+mark {
89
+    background-color: black;
90
+    color: black;
91
+}
92
+
93
+mark:hover {
94
+    background-color: inherit;
95
+}
96
+
97
+.revealed-spoiler {
98
+    background-color: inherit;
99
+    color: red;
100
+}
101
+
88 102
 .jb3-bigorno {
89 103
 	border: 1px solid #F00;
90 104
 }
... ...
@@ -73,6 +73,9 @@ document.addEventListener('DOMContentLoaded', function () {
73 73
                             this.$refs.message.focus();
74 74
                         }
75 75
                         break;
76
+                    case 'MARK':
77
+                        e.target.classList.toggle('revealed-spoiler');
78
+                        break;
76 79
                 }
77 80
             },
78 81
             mouseEntered: function (e) {
... ...
@@ -84,7 +84,11 @@ closeTag
84 84
  }
85 85
 
86 86
 validFormatTag
87
- = ("b" / "i" / "s" / "u" / "tt")
87
+ = (spoiler / "b" / "i" / "s" / "u" / "tt")
88
+
89
+spoiler
90
+ = "spoiler"
91
+ { return "mark"; }
88 92
 
89 93
 invalidOpenTag
90 94
  = "<" tag:invalidTag ">"