This commit is contained in:
Andrey Kuvshinov
2020-04-08 22:39:21 +03:00
parent e5316a2a41
commit 69ef207b50
3 changed files with 22 additions and 15 deletions

View File

@@ -30,7 +30,7 @@ function anpromo_kuri($page = 1, $scale = 1.5){
function read_kuri($hash, $page = 1, $scale = 2, $promo = false){ function read_kuri($hash, $page = 1, $scale = 1.5, $promo = false){
$price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1"); $price = db_get("SELECT `price_id`, `pricename` FROM `price` WHERE `pricehash` = '$hash' LIMIT 1");
@@ -96,7 +96,7 @@ function promo_kuri($hash, $page = 1, $scale = 2, $promo = false){
$prevurl = "$baseurl$prevpage"; $prevurl = "$baseurl$prevpage";
} }
include ('anpdf.phtml'); include ('anpdf2.phtml');
} }

View File

@@ -2,7 +2,7 @@
<head> <head>
<title>Еженедельник Аргументы Недели - <?=$title?></title> <title>Еженедельник Аргументы Недели - <?=$title?></title>
<script src="/pub/scripts/pdf.min.js"></script> <script src="/pub/scripts/pdf.min.js"></script>
<script src="/pub/scripts/anviewer.js?ver=4"></script> <script src="/pub/scripts/anviewer.js?ver=5"></script>
<link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico"> <link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico">
</head> </head>
<body style="width: 87%;margin: 0px auto;margin-top: 2%;background: #f5f5f5;"> <body style="width: 87%;margin: 0px auto;margin-top: 2%;background: #f5f5f5;">

View File

@@ -73,35 +73,42 @@ function pdfzoomout(){
function getzoom(){ function getzoom(){
var cname = 'pdfscale'; var name = 'pdfscale';
var results = document.cookie.match ( '(^|;) ?' + cname + '=([^;]*)(;|$)' ); var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' );
if ( results ) if ( results ){
return ( unescape ( results[2] ) ); return parseFloat(unescape(results[2]));
else }
else {
return null; return null;
}
} }
function setzoom( cvalue, exdays = 30 ) { function setzoom( cvalue, exdays = 30 ) {
var cname = 'pdfscale';
var d = new Date(); var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000)); d.setTime(d.getTime() + (exdays*24*60*60*1000));
var cname = 'pdfscale';
document.cookie = cname + "=" + cvalue + "; expires=" + expires + "; path=/";
} var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function startpdfviewer(){ function startpdfviewer(){
czoom = getzoom(); czoom = getzoom();
if (czoom !== null || isNaN(czoom)) if (czoom != null)
scale = czoom; scale = czoom;
pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) { pdfjsLib.getDocument(url).promise.then(function(pdfDoc_) {
pdfDoc = pdfDoc_; pdfDoc = pdfDoc_;
renderPage(); renderPage();