]> source.dussan.org Git - nextcloud-server.git/commitdiff
merged with stash
authorBartek Przybylski <bart.p.pl@gmail.com>
Wed, 21 Dec 2011 17:37:17 +0000 (18:37 +0100)
committerBartek Przybylski <bart.p.pl@gmail.com>
Wed, 21 Dec 2011 17:37:17 +0000 (18:37 +0100)
apps/gallery/css/styles.css
apps/gallery/js/albums.js
apps/gallery/templates/view_album.php

index e23d822fec781b2cd840fdbff1a55ef761d6448e..2178a4224d1970f82bbc3019e5e5a371a55e34a1 100644 (file)
@@ -14,6 +14,8 @@ div#gallery_album_box {
   display: inline-block;
   margin: 5pt;
   vertical-align: top;
+  padding: 10px;
+  border: solid 1px black;
 }
 .leftcontent div#gallery_album_box {
   margin: 5px;
@@ -27,7 +29,14 @@ div#gallery_album_box h1 {
 div#gallery_album_cover {
   width: 199px;
   height: 199px;
-  border: solid 1px black;
+  border: solid 1px #999;
+  padding: 0;
+}
+
+div#gallery_control_overlay {
+  width:199px;
+  height:199px;
+  position:relative;
 }
 
 #gallery_images {
index 387cc611d5fe23a505d3c8b715a2aab97a54177d..7ffa2cf891daedc4c5c26d0e00220c9dc84fadd3 100644 (file)
@@ -57,14 +57,15 @@ Albums={
   // displays gallery in linear representation
   // on given element, and apply default styles for gallery
   display: function(element) {
-    var displayTemplate = '<div id="gallery_album_box" title="*NAME*"><a href="?view=*NAME*"><div id="gallery_album_cover"></div></a><h1>*NAME*</h1></div></div>';
+    var displayTemplate = '<div id="gallery_album_box" title="*NAME*"><a href="#?view=*NAME*"><div id="#gallery_control_overlay"><div id="gallery_album_cover" title="*NAME*"></div></div></a><h1>*NAME*</h1></div></div>';
     for (var i in Albums.albums) {
       var a = Albums.albums[i];
       var local = $(displayTemplate.replace(/\*NAME\*/g, a.name));
-      local.css('background-repeat', 'no-repeat');
-      local.css('background-position', '0 0');
-      local.css('background-image','url("'+a.backgroundPath+'")');
-      local.mousemove(function(e) {
+      $("#gallery_album_cover", local).css('background-repeat', 'no-repeat');
+      $("#gallery_album_cover", local).css('background-position', '0');
+      $("#gallery_album_cover", local).css('background-image','url("ajax/getCovers.php?album_name='+a.name+'")');
+      $("#gallery_album_cover", local).mousemove(function(e) {
+
         var albumMetadata = Albums.find(this.title);
         if (albumMetadata == undefined) {
           return;
@@ -75,6 +76,13 @@ Albums={
       });
       $(element).append(local);
     }
+  },
+  rename: function(element, new_name) {
+    if (new_name) {
+               $(element).attr("title", new_name);
+               $("a", element).attr("href", "?view="+new_name);
+               $("h1", element).text(new_name);
+       }
   }
 
 }
index ae43e2fc557573e16c7e2365a88da1ea9ed2c578..4acc965269cc2574a6fb5921ede6e54c1b79debb 100644 (file)
@@ -15,7 +15,8 @@ OC_Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' );
 </script>
 
 <div id="controls">
-  <a href="?"><input type="button" value="Back" /></a><br/>
+  <a href="?"><input type="button" value="Back" /></a>
+<br/>
 </div>
 
 <div id="gallery_list" class="leftcontent">