From 9b8c0bffc47dd2f484a78f745412442c37a8a442 Mon Sep 17 00:00:00 2001 From: mpl Date: Wed, 21 Nov 2012 18:48:35 +0100 Subject: [PATCH] ui, recent permanodes: tiled thumbnails style Change-Id: Ie31753e01a897b72eb7996d93d8ea8cdfe5efa54 --- server/camlistored/ui/camli.css | 17 +++++++++++++++++ server/camlistored/ui/recent.js | 2 ++ server/camlistored/ui/zembed_camli.css.go | 19 ++++++++++++++++++- server/camlistored/ui/zembed_recent.js.go | 4 +++- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/server/camlistored/ui/camli.css b/server/camlistored/ui/camli.css index 699f345b6..089feeab6 100644 --- a/server/camlistored/ui/camli.css +++ b/server/camlistored/ui/camli.css @@ -73,3 +73,20 @@ body { color: #fff; } +/* tiled thumbnails */ +.camli-ui-thumb { + margin: 0 auto; + border: 1px solid gray; + padding: 0.5em; + border: 0.5em; + width: 200px; + height: 200px; + max-width: 200px; + max-height: 200px; + float: left; + overflow: hidden; +} +.camli-ui-thumbtitle:hover { + border: 2px solid black; + background: #999; +} diff --git a/server/camlistored/ui/recent.js b/server/camlistored/ui/recent.js index 32cfcab27..0991e83c6 100644 --- a/server/camlistored/ui/recent.js +++ b/server/camlistored/ui/recent.js @@ -35,7 +35,9 @@ function indexBuildRecentlyUpdatedPermanodes(searchRes) { divperm.appendChild(alink); var title = document.createElement("p"); setTextContent(title, camliBlobTitle(br.blobRef, searchRes)); + title.className = 'camli-ui-thumbtitle'; divperm.appendChild(title); + divperm.className = 'camli-ui-thumb'; divrecent.appendChild(divperm); } } diff --git a/server/camlistored/ui/zembed_camli.css.go b/server/camlistored/ui/zembed_camli.css.go index a889394a4..0337dd6bd 100644 --- a/server/camlistored/ui/zembed_camli.css.go +++ b/server/camlistored/ui/zembed_camli.css.go @@ -80,5 +80,22 @@ func init() { " color: #fff;\n"+ "}\n"+ "\n"+ - "", time.Unix(0, 1330389504169976807)) + "/* tiled thumbnails */\n"+ + ".camli-ui-thumb {\n"+ + " margin: 0 auto;\n"+ + " border: 1px solid gray;\n"+ + " padding: 0.5em;\n"+ + " border: 0.5em;\n"+ + " width: 200px;\n"+ + " height: 200px;\n"+ + " max-width: 200px;\n"+ + " max-height: 200px;\n"+ + " float: left;\n"+ + " overflow: hidden;\n"+ + "}\n"+ + ".camli-ui-thumbtitle:hover {\n"+ + " border: 2px solid black;\n"+ + " background: #999;\n"+ + "}\n"+ + "", time.Unix(0, 1353519984757065678)) } diff --git a/server/camlistored/ui/zembed_recent.js.go b/server/camlistored/ui/zembed_recent.js.go index 72b8cfd28..fa8244f6a 100644 --- a/server/camlistored/ui/zembed_recent.js.go +++ b/server/camlistored/ui/zembed_recent.js.go @@ -43,11 +43,13 @@ func init() { " divperm.appendChild(alink);\n"+ " var title = document.createElement(\"p\");\n"+ " setTextContent(title, camliBlobTitle(br.blobRef, searchRes));\n"+ + " title.className = 'camli-ui-thumbtitle';\n"+ " divperm.appendChild(title);\n"+ + " divperm.className = 'camli-ui-thumb';\n"+ " divrecent.appendChild(divperm);\n"+ " }\n"+ "}\n"+ "\n"+ "window.addEventListener(\"load\", indexOnLoad);\n"+ - "", time.Unix(0, 1352732421861382276)) + "", time.Unix(0, 1353518413264563890)) }