Skip to content

Commit

Permalink
Look and feel improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
djcp committed Apr 25, 2012
1 parent 0f5c331 commit 2a4c4c4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
16 changes: 9 additions & 7 deletions javascripts/covered.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $.extend({
'dpla.oclc': 'OCLC',
'dpla.lccn': 'LCCN',
'dpla.call_num': 'Call Number',
'dpla.content_link': 'Context Link',
'dpla.content_link': 'Content Link',
'dpla.contributor': 'Contributor',
'dpla.resource_type': 'Resource Type'
};
Expand All @@ -32,17 +32,19 @@ $.extend({

if(typeof(d['dpla.isbn']) === 'object'){
var isbn = d['dpla.isbn'][0].split('%%')[0];
nodeContent += '<img src="http://covers.openlibrary.org/b/isbn/' + isbn + '-S.jpg" class="cover" />';
nodeContent += '<img src="http://covers.openlibrary.org/b/isbn/' + isbn + '-M.jpg" class="cover" />';
}else if(typeof(d['dpla.isbn'] == 'string')){
nodeContent += '<img src="http://covers.openlibrary.org/b/isbn/' + d['dpla.isbn'] + '-S.jpg" class="cover" />';
nodeContent += '<img src="http://covers.openlibrary.org/b/isbn/' + d['dpla.isbn'] + '-M.jpg" class="cover" />';
}

if(d['dpla.content_link']){
nodeContent += '<a target="_blank" href="' + d['dpla.content_link'] + '">';
}
nodeContent += (d['dpla.title']) ? $.ellipsisSubstr(d['dpla.title']) : 'Untitled Work';
if(d.content_link){nodeContent += '</a>';}
nodeContent += '<span class="data_source">' + d['dpla.contributor'] + '</span>';
nodeContent += '<span class="title">' + ( (d['dpla.title']) ? $.ellipsisSubstr(d['dpla.title']) : 'Untitled Work' ) + '</span>';
if(d['dpla.content_link']){
nodeContent += '</a>';
}
nodeContent += '<br/><span class="data_source">' + d['dpla.contributor'] + '</span>';
facets[d['dpla.contributor']] = (facets[d['dpla.contributor']] == undefined) ? 1 : (facets[d['dpla.contributor']] + 1);
return node.append(nodeContent).data('d',d);
},
Expand Down Expand Up @@ -107,7 +109,7 @@ $.extend({
$('#target').isotope({filter: $(this).attr('data_filter_class')});
});
// relayout as cover images may've effected container height.
setTimeout(function(){$('#target').isotope('reLayout')}, 500);
setTimeout(function(){$('#target').isotope('reLayout')}, 1000);
},

initSearchables: function(){
Expand Down
25 changes: 15 additions & 10 deletions stylesheets/covered.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,23 @@ input, select{
}

.doc{
width:280px;
width:350px;
background-color: #ccc;
margin: 0px 1em 1em 0px;
padding: .25em;
margin: 0px 10px 10px 0px;
padding: 20px;
border-radius: 5px;
clear: both;
font-size: 10pt;
cursor:pointer;
}
.doc:hover{
background-color:#999;
}
.doc img{
float:left;
margin:0 5px 5px 0;
}
.doc:hover{
background-color:#999;
}

.doc img{
float:left;
margin:0 5px 5px 0;
}

.doc .data_source{
font-size: 10px;
Expand All @@ -134,3 +135,7 @@ input, select{
float: left;
margin: 0px 5px 0px 0px;
}

.doc .title{
font-weight: bold;
}

0 comments on commit 2a4c4c4

Please sign in to comment.