3 <title>Pictureviewer2
</title>
4 <meta http-equiv=
"CONTENT-TYPE" content=
"text/html; charset=utf-8" >
5 <meta name=
"author" content=
"Dietmar" >
6 <meta name=
"CHANGED" content=
"20191027;20000001">
8 <link rel=
"stylesheet" type=
"text/css" href=
"Pictureviewer.css">
10 <script src=
"PictureList.txt" type=
"text/javascript" charset=
"utf-8"></script>
13 var cDefault_FileN_Style =
"Pic_Filename";
14 var Pic_curr; // current picture number
15 var Pic_num ; // last picture number
16 var ID_Body; // ID des Bodies
17 var ID_Anzeige; // Anzeigelement: Bild, Video, ..
18 var picturenumber; // number typed by user for direct access to pictures
19 var pictureList = new Array();
21 function Doc_Init() { // Init document
22 ID_Body = document.getElementById(
"ID_Body");
23 ID_Body.onkeyup = ChangePic;
24 ID_Body.onmouseup=HandleMouseEvent;
25 ID_Anzeige = document.getElementById(
"idAnzeige");
27 // if (window.location.search !=
"") // does not really help, because PictureList is already included
28 // pic_dir = window.location.search.substr(
1,
99)+
"/"+pic_dir; // remove
"?", add separator ***
30 pictureList = pictureString.split(
"\n");
31 Pic_num = pictureList.length-
1;
37 if (Pic_curr
> Pic_num) Pic_curr = Pic_num;
38 if (Pic_curr <
0) Pic_curr =
0;
40 ID_Anzeige.innerHTML = pictureList[Pic_curr];
44 function ChangePic(Keyhandler){
45 if (!Keyhandler) Keyhandler = window.event;
46 tastatur = Keyhandler.key;
48 case
"Home": //
"POS1":
1st picture
51 case
"End": //
"Ende": last picture
54 case
"a": // reload picture
58 case
"v": // next picture
64 case
"b": // back picture
71 SetPic(Pic_curr+picturenumber);
74 SetPic(Pic_curr-picturenumber);
86 picturenumber=picturenumber*
10+Number(tastatur);
88 case
"g": //
"g": goto
89 SetPic(picturenumber);
91 case
"x": //
"x" to close
97 function BackPicture() {
101 function NextPicture() {
105 function HandleMouseEvent(e) {
106 if (!e) e = window.event;
107 LeftClicked =
0.33; // left clicked if in left
33%
108 RightClicked =
0.66; // left clicked if in right
33%
109 WindowWidth = window.innerWidth;
110 if (e.clientX < (WindowWidth*LeftClicked)) { BackPicture() }
111 else if (e.clientX
> (WindowWidth*RightClicked)) { NextPicture() }
118 <body id=
"ID_Body" onload=
"Doc_Init()">
120 <span id=
"idAnzeige"></span>