Did you know ... Search Documentation:
GIT commit info
CSS and icon support for examples.
authorJan Wielemaker
Mon Dec 14 12:03:39 2020 +0100
committerJan Wielemaker
Mon Dec 14 16:21:04 2020 +0100
commit7c170ade10947b959df991b18ee98a04aadb90fc
tree76188ff6939f88ce32686ae57fbcbb77d7e734f0
parent420b4cc480586810b00b70f988ff70857493a60f
Diff style: patch stat
diff --git a/css/examples.css b/css/examples.css
new file mode 100644
index 0000000..4507df7
--- /dev/null
+++ b/css/examples.css
@@ -0,0 +1,52 @@
+/* Examples */
+
+.ex-list {
+  overflow: hidden;
+}
+
+.ex-list h4 {
+  background-color: #16a1ca;
+  color: #fff;
+  padding: 2px 5px 0px 10px;
+  margin-bottom: 5px;
+  font-size: 18px;
+}
+
+.ex-header:hover {
+  text-decoration: underline;
+}
+
+.ex-header .title {
+ padding-left: 5px;
+ position: relative;
+ font-weight: bold;
+}
+
+.ex-header .author {
+ font-style: italic;
+ float:right;
+}
+
+.ex-flag {
+  position: relative;
+  top: 3px;
+  float:left;
+  display: inline-block;
+  width: 18px;
+  height: 16px;
+  padding: 0px;
+  background-repeat: no-repeat;
+  background-size: 100% 100%;
+}
+
+.ex-flag.titleref  { background-image: url("../icons/star.png"); }
+.ex-flag.query     { background-image: url("../icons/query.png"); }
+.ex-flag.called    { background-image: url("../icons/called.png"); }
+.ex-flag.reference { background-image: url("../icons/ref.png"); }
+
+.ex-content h1:first-of-type { display: none; }
+.ex-content .keyword-author  { display: none; }
+
+.ex            .ex-content { display: none; }
+.ex.ex-current .ex-content { display: block; }
+.ex.primary    .ex-content { display: block; }
diff --git a/css/plweb.css b/css/plweb.css
index 58cd576..b5d2850 100644
--- a/css/plweb.css
+++ b/css/plweb.css
@@ -208,4 +208,3 @@ span.openid-url-pattern
 .menu-item {
   text-transform:uppercase;
 }
-
diff --git a/icons/called.png b/icons/called.png
new file mode 100644
index 0000000..f8da15b
Binary files /dev/null and b/icons/called.png differ
diff --git a/icons/query.png b/icons/query.png
new file mode 100644
index 0000000..7730dd0
Binary files /dev/null and b/icons/query.png differ
diff --git a/icons/ref.png b/icons/ref.png
new file mode 100644
index 0000000..dc44c79
Binary files /dev/null and b/icons/ref.png differ
diff --git a/icons/star.png b/icons/star.png
new file mode 100644
index 0000000..5fcaa31
Binary files /dev/null and b/icons/star.png differ
diff --git a/js/examples.js b/js/examples.js
new file mode 100644
index 0000000..674025a
--- /dev/null
+++ b/js/examples.js
@@ -0,0 +1,12 @@
+$(function() {
+  $(".ex-header").on("click", function(ev) {
+    var ex = $(ev.target).closest(".ex");
+    if ( ex.hasClass("ex-current") ) {
+      ex.removeClass("ex-current");
+    } else {
+      ex.parent().children().removeClass("ex-current");
+      ex.addClass("ex-current");
+    }
+    ev.stopPropagation();
+  });
+});