Addresses #400, Report generation
CSS updates from Jeremy with some streamlining by me (consistency of print style, removal of unnecessary lines, and some other fixes) Changed doctype to XHTML 1.0 Strict from 1.1 Adding /html/report.html to end of URL to provide a filename hint for Firefox (instead of the file being called 12345-34567-84573-42632.xhtml)
This commit is contained in:
parent
c2858475a8
commit
26c62fba4b
|
@ -43,13 +43,13 @@ var Zotero_Report_Interface = new function() {
|
|||
}
|
||||
|
||||
if (id) {
|
||||
window.loadURI('zotero://report/collection/' + id + queryString);
|
||||
window.loadURI('zotero://report/collection/' + id + '/html/report.html' + queryString);
|
||||
return;
|
||||
}
|
||||
|
||||
var id = ZoteroPane.getSelectedSavedSearch(true);
|
||||
if (id) {
|
||||
window.loadURI('zotero://report/search/' + id + queryString);
|
||||
window.loadURI('zotero://report/search/' + id + '/html/report.html' + queryString);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ var Zotero_Report_Interface = new function() {
|
|||
throw ('No items currently selected');
|
||||
}
|
||||
|
||||
window.loadURI('zotero://report/items/' + items.join('-'));
|
||||
window.loadURI('zotero://report/items/' + items.join('-') + '/html/report.html');
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,6 +79,6 @@ var Zotero_Report_Interface = new function() {
|
|||
throw ('No itemIDs provided to loadItemReportByIds()');
|
||||
}
|
||||
|
||||
window.loadURI('zotero://report/items/' + ids.join('-'));
|
||||
window.loadURI('zotero://report/items/' + ids.join('-') + '/html/report.html');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,12 +35,13 @@ Zotero.Report = new function() {
|
|||
var ZU = new Zotero.Utilities();
|
||||
var escapeXML = ZU.htmlSpecialChars;
|
||||
|
||||
var content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ';
|
||||
content += '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n';
|
||||
var content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ';
|
||||
content += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n';
|
||||
content += '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\n';
|
||||
content += '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n';
|
||||
content += '<title>' + Zotero.getString('report.title.default') + '</title>\n';
|
||||
content += '<link rel="stylesheet" type="text/css" href="chrome://zotero/skin/report/detail.css"/>\n';
|
||||
content += '<link rel="stylesheet" type="text/css" media="screen,projection" href="chrome://zotero/skin/report/detail_screen.css"/>\n';
|
||||
content += '<link rel="stylesheet" type="text/css" media="print" href="chrome://zotero/skin/report/detail_print.css"/>\n';
|
||||
content += '</head>\n<body>\n';
|
||||
|
||||
|
@ -48,7 +49,7 @@ Zotero.Report = new function() {
|
|||
for each(var arr in items) {
|
||||
//Zotero.debug(arr);
|
||||
|
||||
content += '<li id="i' + arr.itemID + '" class="' + arr.itemType + '"><span>\n';
|
||||
content += '<li id="i' + arr.itemID + '" class="item ' + arr.itemType + '">\n';
|
||||
|
||||
// Title
|
||||
if (arr.title) {
|
||||
|
@ -257,7 +258,7 @@ Zotero.Report = new function() {
|
|||
}
|
||||
|
||||
|
||||
content += '</span></li>\n';
|
||||
content += '</li>\n';
|
||||
}
|
||||
content += '</ul>\n';
|
||||
content += '</body>\n</html>';
|
||||
|
|
|
@ -1,110 +1,70 @@
|
|||
/* Fonts */
|
||||
li, li > p {
|
||||
font-family: Georgia, Times New Roman, Times, serif;
|
||||
font-size: .95em;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.3em;
|
||||
margin: .4em 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.05em;
|
||||
}
|
||||
th, td {
|
||||
font-size: .95em;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
body {
|
||||
padding: 0;
|
||||
}
|
||||
ul li {
|
||||
list-style: none;
|
||||
|
||||
ul.report li.item {
|
||||
border-top: 4px solid #555;
|
||||
padding-top: 1em;
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* Line between items */
|
||||
ul.report > li {
|
||||
h2 {
|
||||
margin: 0 0 .75em;
|
||||
padding: 0 0 0.25em;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-bottom: .5em;
|
||||
font-weight: bold !important;
|
||||
font-size: 1em;
|
||||
display: block;
|
||||
border-bottom: 1px #333 solid;
|
||||
padding: .95em 0;
|
||||
}
|
||||
ul.report > li:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
ul.report > li:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
ul.report > li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
|
||||
/* Metadata table */
|
||||
table {
|
||||
border: 1px #ccc solid;
|
||||
float: right;
|
||||
width: 35%;
|
||||
margin: .1em 0 .75em 1.5em;
|
||||
padding: .2em .3em;
|
||||
background: #fff;
|
||||
}
|
||||
th {
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
padding-right: .1em;
|
||||
width: 15%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
th:after {
|
||||
content: ':';
|
||||
|
||||
td {
|
||||
padding-left: .5em;
|
||||
}
|
||||
|
||||
|
||||
/* Tags and child notes */
|
||||
ul ul {
|
||||
padding: 0 .5em;
|
||||
ul {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
h3 {
|
||||
margin-bottom: .4em;
|
||||
}
|
||||
h3:after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
|
||||
/* Display tags as comma-separated lists */
|
||||
ul.tags {
|
||||
line-height: 1.75em;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
ul.tags li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
ul.tags li:not(:last-child):after {
|
||||
content: ', ';
|
||||
}
|
||||
|
||||
|
||||
/* Child notes */
|
||||
ul.notes {
|
||||
margin-left: 1em;
|
||||
}
|
||||
ul.notes li {
|
||||
display: inline;
|
||||
}
|
||||
ul.notes li:first-child p:first-child {
|
||||
margin-top: 1em;
|
||||
}
|
||||
ul.notes li p:first-child {
|
||||
margin-top: .7em;
|
||||
display: list-item;
|
||||
list-style: square outside;
|
||||
}
|
||||
|
||||
/* Preserve whitespace on notes */
|
||||
ul.notes li p, li.note p {
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
white-space: pre-wrap; /* css-3 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
white-space: -pre-wrap; /* Opera 4-6 */
|
||||
white-space: -o-pre-wrap; /* Opera 7 */
|
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
||||
}
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
body {
|
||||
font: 12pt "Times New Roman", Times, Georgia, serif;
|
||||
margin: 0;
|
||||
width: auto;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* Page Breaks (page-break-inside only recognized by Opera) */
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
page-break-after: avoid;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
ul, ol, dl {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.3em;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #000;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Firefox gets funky with floated elements that span two pages, so we pretend we're a table
|
||||
*/
|
||||
ul.report {
|
||||
display: table;
|
||||
}
|
||||
|
||||
ul.report > li {
|
||||
display: table-row;
|
||||
page-break-inside: avoid; /* Waiting on https://bugzilla.mozilla.org/show_bug.cgi?id=132035 */
|
||||
}
|
||||
|
||||
ul.report > li > span {
|
||||
display: table-cell;
|
||||
border-bottom: 1px solid #000; /* Normal <li> border disappears in table mode */
|
||||
padding: .95em 0;
|
||||
}
|
||||
|
||||
ul.report > li:last-child > span {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
|
42
chrome/skin/default/zotero/report/detail_screen.css
Normal file
42
chrome/skin/default/zotero/report/detail_screen.css
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* Generic styles */
|
||||
body {
|
||||
font: 62.5% Georgia, Times, serif;
|
||||
width: 780px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.5em;
|
||||
font-family: Georgia, Times, serif;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #900;
|
||||
}
|
||||
|
||||
a:hover, a:active {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
|
||||
ul.report {
|
||||
font-size: 1.4em;
|
||||
width: 680px;
|
||||
margin: 0 auto;
|
||||
overflow: auto;
|
||||
padding: 20px 20px;
|
||||
}
|
||||
|
||||
/* Metadata table */
|
||||
table {
|
||||
border: 1px #ccc solid;
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
margin: .1em auto .75em;
|
||||
padding: 0.5em;
|
||||
}
|
Loading…
Reference in New Issue
Block a user