|
|
| 16 |
{elseif $galley->isPdfGalley()} |
16 |
{elseif $galley->isPdfGalley()} |
| 17 |
{url|assign:"pdfUrl" op="viewFile" path=$articleId|to_array:$galley->getBestGalleyId($currentJournal)} |
17 |
{url|assign:"pdfUrl" op="viewFile" path=$articleId|to_array:$galley->getBestGalleyId($currentJournal)} |
| 18 |
{translate|assign:"noPluginText" key='article.pdf.pluginMissing'} |
18 |
{translate|assign:"noPluginText" key='article.pdf.pluginMissing'} |
| 19 |
<script type="text/javascript">{literal} |
19 |
<script type="text/javascript"><!--{literal} |
| 20 |
$(document).ready(function(){ |
20 |
$(document).ready(function(){ |
| 21 |
if ($.browser.webkit) { // PDFObject does not correctly work with safari's built-in PDF viewer |
21 |
if ($.browser.webkit) { // PDFObject does not correctly work with safari's built-in PDF viewer |
| 22 |
var embedCode = "<object id='pdfObject' type='application/pdf' data='{/literal}{$pdfUrl}{literal}' width='99%' height='99%'><div id='pluginMissing'>{/literal}{$noPluginKey}{literal}</div></object>"; |
22 |
var embedCode = "<object id='pdfObject' type='application/pdf' data='{/literal}{$pdfUrl|escape:'javascript'}{literal}' width='99%' height='99%'><div id='pluginMissing'>{/literal}{$noPluginText|escape:'javascript'}{literal}</div></object>"; |
| 23 |
$("#articlePdf").html(embedCode); |
23 |
$("#articlePdf").html(embedCode); |
| 24 |
if($("#pluginMissing").is(":hidden")) { |
24 |
if($("#pluginMissing").is(":hidden")) { |
| 25 |
$('#fullscreenShow').show(); |
25 |
$('#fullscreenShow').show(); |
| 26 |
$("#articlePdf").resizable({ containment: 'parent', handles: 'se' }); |
26 |
$("#articlePdf").resizable({ containment: 'parent', handles: 'se' }); |
| 27 |
} else { // Chrome Mac hides the embed object, obscuring the text. Reinsert. |
27 |
} else { // Chrome Mac hides the embed object, obscuring the text. Reinsert. |
| 28 |
$("#articlePdf").html('{/literal}{$noPluginText}{literal}'); |
28 |
$("#articlePdf").html('{/literal}{$noPluginText|escape:"javascript"}{literal}'); |
| 29 |
} |
29 |
} |
| 30 |
} else { |
30 |
} else { |
| 31 |
var success = new PDFObject({ url: "{/literal}{$pdfUrl}{literal}" }).embed("articlePdf"); |
31 |
var success = new PDFObject({ url: "{/literal}{$pdfUrl|escape:'javascript'}{literal}" }).embed("articlePdf"); |
| 32 |
if (success) { |
32 |
if (success) { |
| 33 |
// PDF was embedded; enbale fullscreen mode and the resizable widget |
33 |
// PDF was embedded; enbale fullscreen mode and the resizable widget |
| 34 |
$('#fullscreenShow').show(); |
34 |
$('#fullscreenShow').show(); |
|
|
| 36 |
} |
36 |
} |
| 37 |
} |
37 |
} |
| 38 |
}); |
38 |
}); |
| 39 |
{/literal}</script> |
39 |
{/literal} |
|
|
40 |
// --> |
| 41 |
</script> |
| 40 |
<div id="articlePdfResizer"> |
42 |
<div id="articlePdfResizer"> |
| 41 |
<div id="articlePdf" class="ui-widget-content"> |
43 |
<div id="articlePdf" class="ui-widget-content"> |
| 42 |
{translate key="article.pdf.pluginMissing"} |
44 |
{translate key="article.pdf.pluginMissing"} |