|
@@ -3,7 +3,6 @@ var imglist = null;
|
|
var dirname = null;
|
|
var dirname = null;
|
|
var filename = null;
|
|
var filename = null;
|
|
var currId = 0;
|
|
var currId = 0;
|
|
-const urlPrefix = '/obrazki/';
|
|
|
|
|
|
|
|
function setLinks(e) {
|
|
function setLinks(e) {
|
|
var doPush = false;
|
|
var doPush = false;
|
|
@@ -18,13 +17,13 @@ function setLinks(e) {
|
|
/* replace the content */
|
|
/* replace the content */
|
|
filename = imglist[currId].name;
|
|
filename = imglist[currId].name;
|
|
if (currId > 0) {
|
|
if (currId > 0) {
|
|
- $('#poprz').attr('href', urlPrefix + 'image.php?dir=' + dirname + '&file=' + imglist[currId-1].name);
|
|
|
|
|
|
+ $('#poprz').attr('href', scriptUrlPrefix + 'image.php?dir=' + dirname + '&file=' + imglist[currId-1].name);
|
|
$('#poprz').show();
|
|
$('#poprz').show();
|
|
} else {
|
|
} else {
|
|
$('#poprz').hide();
|
|
$('#poprz').hide();
|
|
}
|
|
}
|
|
if (currId < imglist.length - 1) {
|
|
if (currId < imglist.length - 1) {
|
|
- var url = urlPrefix + 'image.php?dir=' + dirname + '&file=' + imglist[currId+1].name;
|
|
|
|
|
|
+ var url = scriptUrlPrefix + 'image.php?dir=' + dirname + '&file=' + imglist[currId+1].name;
|
|
$('#nast').attr('href', url);
|
|
$('#nast').attr('href', url);
|
|
$('#imagelink').attr('href', url);
|
|
$('#imagelink').attr('href', url);
|
|
$('#nast').show();
|
|
$('#nast').show();
|
|
@@ -35,13 +34,13 @@ function setLinks(e) {
|
|
var image = $("#image");
|
|
var image = $("#image");
|
|
// image.fadeTo('fast', 0.2, function () {
|
|
// image.fadeTo('fast', 0.2, function () {
|
|
image.css('opacity', '0.2');
|
|
image.css('opacity', '0.2');
|
|
- image.attr('src', urlPrefix + dirname + '/' + filename);
|
|
|
|
|
|
+ image.attr('src', imageUrlPrefix + dirname + '/' + filename);
|
|
image.on('load', function() {
|
|
image.on('load', function() {
|
|
// image.fadeTo('fast', 1);
|
|
// image.fadeTo('fast', 1);
|
|
image.css('opacity', '1');
|
|
image.css('opacity', '1');
|
|
});
|
|
});
|
|
if (doPush)
|
|
if (doPush)
|
|
- window.history.pushState(currId, '', urlPrefix + 'image.php?dir=' + dirname + '&file=' + filename);
|
|
|
|
|
|
+ window.history.pushState(currId, '', scriptUrlPrefix + 'image.php?dir=' + dirname + '&file=' + filename);
|
|
// });
|
|
// });
|
|
}
|
|
}
|
|
|
|
|
|
@@ -81,7 +80,7 @@ function imglistReceived(data) {
|
|
$('#imagelink').click(nextImage);
|
|
$('#imagelink').click(nextImage);
|
|
$('#nast').click(nextImage);
|
|
$('#nast').click(nextImage);
|
|
window.onpopstate = setLinks;
|
|
window.onpopstate = setLinks;
|
|
- window.history.replaceState(currId, '', urlPrefix + 'image.php?dir=' + dirname + '&file=' + filename);
|
|
|
|
|
|
+ window.history.replaceState(currId, '', scriptUrlPrefix + 'image.php?dir=' + dirname + '&file=' + filename);
|
|
}
|
|
}
|
|
|
|
|
|
function getImgList() {
|
|
function getImgList() {
|
|
@@ -96,7 +95,7 @@ function getImgList() {
|
|
var args = 'dir=' + dirname;
|
|
var args = 'dir=' + dirname;
|
|
$.ajax({
|
|
$.ajax({
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
- url: urlPrefix+'dirlist.php?'+args,
|
|
|
|
|
|
+ url: scriptUrlPrefix+'dirlist.php?'+args,
|
|
success: imglistReceived
|
|
success: imglistReceived
|
|
});
|
|
});
|
|
}
|
|
}
|