aboutsummaryrefslogtreecommitdiff
path: root/development/cgit/config
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2014-03-19 07:51:57 +0700
committerErik Hanson <erik@slackbuilds.org>2014-03-21 13:01:21 -0500
commite3e3ccdfeb860b2384c469e66290f653dcdbcc07 (patch)
tree123bac94c6a37786590962a076f9e5a20e69936f /development/cgit/config
parent6d5d8cbfac9e60d682a847e0c58636b24293cffb (diff)
development/cgit: Updated for version 0.10.1.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/cgit/config')
-rw-r--r--development/cgit/config/cgitrc.sample3
-rw-r--r--development/cgit/config/email-gravatar-sbo-additions.css28
-rw-r--r--development/cgit/config/email-gravatar-sbo.lua26
-rw-r--r--development/cgit/config/email-libravatar-korg-additions.css28
-rw-r--r--development/cgit/config/email-libravatar-korg.lua15
5 files changed, 100 insertions, 0 deletions
diff --git a/development/cgit/config/cgitrc.sample b/development/cgit/config/cgitrc.sample
index 0f3c91a60a73..cd23168d0435 100644
--- a/development/cgit/config/cgitrc.sample
+++ b/development/cgit/config/cgitrc.sample
@@ -7,6 +7,9 @@ root-desc=a fast interface to these git repositories
virtual-root=/
snapshots=tar.gz
branch-sort=age
+# for this to work you have to build cgit against lua
+# and install luacrypto too
+email-filter=lua:/usr/share/cgit/filters/email-gravatar-sbo.lua
#css=/static/cgit.css
#logo=/static/cgit.png
diff --git a/development/cgit/config/email-gravatar-sbo-additions.css b/development/cgit/config/email-gravatar-sbo-additions.css
new file mode 100644
index 000000000000..f7dbc32f41a1
--- /dev/null
+++ b/development/cgit/config/email-gravatar-sbo-additions.css
@@ -0,0 +1,28 @@
+div#cgit span.gravatar img.onhover {
+ display: none;
+ border: 1px solid gray;
+ padding: 0px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ width: 128px;
+ height: 128px;
+}
+
+div#cgit span.gravatar img.inline {
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ width: 13px;
+ height: 13px;
+ margin-right: 0.2em;
+ opacity: 0.8;
+}
+
+div#cgit span.gravatar:hover > img.onhover {
+ display: block;
+ position: absolute;
+ margin-left: 1.5em;
+ background-color: #eeeeee;
+ box-shadow: 5px 5px 3px #bbb;
+}
diff --git a/development/cgit/config/email-gravatar-sbo.lua b/development/cgit/config/email-gravatar-sbo.lua
new file mode 100644
index 000000000000..0b8cb17ea27c
--- /dev/null
+++ b/development/cgit/config/email-gravatar-sbo.lua
@@ -0,0 +1,26 @@
+-- This script may be used with the email-filter or repo.email-filter settings in cgitrc.
+-- It adds gravatar icons to author names. It is designed to be used with the lua:
+-- prefix in filters. It takes some part from the kernel.org's one.
+--
+-- Requirements:
+-- luacrypto >= 0.3
+-- <http://mkottman.github.io/luacrypto/>
+--
+
+local crypto = require("crypto")
+
+function filter_open(email, page)
+ buffer = ""
+ md5 = crypto.digest("md5", email:sub(2, -2):lower())
+end
+
+function filter_close()
+ html("<span class='gravatar'><img class='inline' src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&amp;d=retro' /><img class='onhover' src='//www.gravatar.com/avatar/" .. md5 .. "?s=128&d=retro' /></span> " .. buffer)
+ return 0
+end
+
+function filter_write(str)
+ buffer = buffer .. str
+end
+
+
diff --git a/development/cgit/config/email-libravatar-korg-additions.css b/development/cgit/config/email-libravatar-korg-additions.css
new file mode 100644
index 000000000000..e44d052865ea
--- /dev/null
+++ b/development/cgit/config/email-libravatar-korg-additions.css
@@ -0,0 +1,28 @@
+div#cgit span.libravatar img.onhover {
+ display: none;
+ border: 1px solid gray;
+ padding: 0px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ width: 128px;
+ height: 128px;
+}
+
+div#cgit span.libravatar img.inline {
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ width: 13px;
+ height: 13px;
+ margin-right: 0.2em;
+ opacity: 0.4;
+}
+
+div#cgit span.libravatar:hover > img.onhover {
+ display: block;
+ position: absolute;
+ margin-left: 1.5em;
+ background-color: #eeeeee;
+ box-shadow: 5px 5px 3px #bbb;
+}
diff --git a/development/cgit/config/email-libravatar-korg.lua b/development/cgit/config/email-libravatar-korg.lua
new file mode 100644
index 000000000000..2d67991d5e3d
--- /dev/null
+++ b/development/cgit/config/email-libravatar-korg.lua
@@ -0,0 +1,15 @@
+local md5 = require("md5")
+
+function filter_open(email, page)
+ buffer = ""
+ hexdigest = md5.sumhexa(email:sub(2, -2):lower())
+end
+
+function filter_close()
+ html("<span class='libravatar'><img class='inline' src='//seccdn.libravatar.org/avatar/" .. hexdigest .. "?s=13&d=retro' /><img class='onhover' src='//seccdn.libravatar.org/avatar/" .. hexdigest .. "?s=128&d=retro' /></span>" .. buffer)
+ return 0
+end
+
+function filter_write(str)
+ buffer = buffer .. str
+end