-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.php
147 lines (138 loc) · 6.27 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
include "../../lg.php";
$q="";
if (isset($_GET['q']))
if ($_GET['q']!="")
$q=str_ireplace("q","",$_GET['q']);
$fic="";
if (isset($_GET['fic']))
if ($_GET['fic']!="")
$fic=$_GET['fic'];
?><!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<title>IIIF Image Cropper</title>
<link rel="stylesheet" href="css/jquery.Jcrop.min.css"> <!-- required for jcrop to work right! -->
<link rel="stylesheet" href="css/main.css">
<link rel=stylesheet href="css/colors.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.Jcrop.min.js"></script>
<script type="text/javascript" src="js/clipboard.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/cropper.js"></script>
<style>
body{
font-size: 13px;
}
#bl_titre a img {
border:1px solid #333 ;
}
#bl_titre {
float:left;
width:65px;
z-index:10;
font-family: Arial, Helvetica, FreeSans, sans-serif;
font-size: 13px;
line-height: 1.3;
color: black;
margin-left:1em;
}
#bl_titre img{
vertical-align:top;
box-sizing: content-box;
}
#bl_titre a,#bl_titre a:link ,#bl_titre a:visited,#bl_titre a:hover,#bl_titre a:focus,#bl_titre a:active{
color:#000000;
text-decoration:none;
}
h1.entete{
font-size:130%;
font-weight:bold;
margin-top:10px;
margin-bottom:10px;
text-align:left;
font:bold 14px Verdana, Geneva, sans-serif;
}
#container h1{
text-align:left;
}
#container p{
font-size:110%;
}
#output{
width:145px;
}
#fragment{
width:150px;
}
#footer{
font-size:110%;
}
</style>
</head>
<body>
<?php include "../entete.php" ?>
<div id="container">
<form id="lgform">
<h1><?php if ($l=="fr") echo "IIIF Image Cropper pour Wikimedia Commons et Wikidata"; else echo "IIIF Image Cropper for Wikimedia Commons and Wikidata" ; ?> - <select name="l" id="lg">
<?php
$lgs=array("en","fr");
include "../../traduction.php";
include "../../functions.php";
for ($i=0;$i<count($lgs);$i++){
echo " <option value=\"".translate($lgs[$i],"lang_code")."\"";
if ($l==$lgs[$i])
echo " selected=\"selected\"";
echo " >".translate($lgs[$i],"lg")."</option>\n";
}
?></select></h1></form>
<?php
if ($l=="fr") { ?>
<p>Outil pour créer des fragments d'image avec URL <a href="http://www.iiif.io" target="_blank">IIIF</a> pour les fichiers image de Wikimedia Commons, et indiquer les valeurs à fournir pour la propriété Wikidata <a href="https://www.wikidata.org/wiki/Property:P2677" target="_blank">position relative dans l'image / P2677</a>. Exemples d'utilisation :<br/>
- pour les fragments sur une œuvre, <a href="/crotos/lab/cropper/get.php?q=21013224">Vierge entre les vierges, Gérard David</a>- <a href="/crotos/lab/cropper/get.php?q=Q1231009">Le Sacre de Napoléon, Jacques-Louis David</a> – <a href="/crotos/lab/cropper/get.php?q=14619165">Galerie de vues de la Rome antique, Giovanni Paolo Panini</a>.</br>
- pour un élement décrit sur plusieurs œuvres. <a href="/crotos/lab/cropper/p180iiif.php">Recherche</a>. Exemple : <a href="/crotos/lab/cropper/p180iiif.php?q=302">Jésus Christ</a>, <a href="/crotos/lab/cropper/p180iiif.php?q=79746">bougie</a>, <a href="/crotos/lab/cropper/p180iiif.php?q=7307">baiser</a></p>
<!--<p>Indiquer un nom de fichier de Wikimedia Commons, et ensuite cliquer-glisser pour délimiter un fragment rectangulaire.</p>-->
<?php
} else {?>
<p>A simple little tool to create image fragments with <a href="http://www.iiif.io" target="_blank">IIIF</a> URL for Wikimedia Commons image files, and to provide values for the Wikidata property <a href="https://www.wikidata.org/wiki/Property:P2677" target="_blank">relative position within image / P2677</a>. Example of use:</br>
- for fragments on an artwork, <a href="/crotos/lab/cropper/get.php?q=21013224">Virgin among the Virgins, Gérard David</a>, <a href="/crotos/lab/cropper/get.php?q=Q1231009">The Coronation of Napoleon, Jacques-Louis David</a> – <a href="/crotos/lab/cropper/get.php?q=14619165">Ancient Rome, Giovanni Paolo Panin</a>.</br>
- for an item depicted by several artworks. <a href="/crotos/lab/cropper/p180iiif.php">Search</a>. Example: <a href="/crotos/lab/cropper/p180iiif.php?q=302">Jesus Christ</a>, <a href="/crotos/lab/cropper/p180iiif.php?q=79746">canddle</a>, <a href="/crotos/lab/cropper/p180iiif.php?q=7307">kiss</a></p>
<!--(example: <a href="https://www.wikidata.org/wiki/Q21013224">Virgin among the Virgins</a> by Gerard David ; <a href="/crotos/lab/cropper/get.php?q=21013224">display</a> – <a href="/crotos/lab/cropper/get.php?q=14619165">example 2</a>)). Input the filename if Wikimedia Commons file, then click and drag on the image to crop.</p>-->
<?php } ?>
<div id="fields">
<label for="URL"><?php if ($l=="fr") echo "Fichier Commons :"; else echo "Commons file:" ; ?></label>
<input type="text" id="URL" name="URL" value="<?php
if ($fic!="")
echo $fic;
else
echo "Quentin_Massys_001.jpg";
?>">
<button type="button" id="submit"><?php if ($l=="fr") echo "Charger"; else echo "Load" ; ?></button>
<?php
if ($q!="")
echo "<a href=\"https://www.wikidata.org/wiki/Q".$q."#P180\">Q".$q."</a>";
?>
<label for="output"><?php if ($l=="fr") echo "Posititon relative :"; else echo "Relative position:" ; ?></label>
<input type="text" name="output" id="output" readonly>
<!-- Copy to clipboad -->
<div class="tooltip-wrap" id="copy-tip">
<button class="btn" id="copy" data-clipboard-target="#output">
<img src="img/clippy.svg" alt="Copy to clipboard">
</button>
<div class="tooltip" id="copy-tip-text">Copied!</div>
</div>
<label for="fragment"><?php if ($l=="fr") echo "Url IIIF :"; else echo "IIIF Url:" ; ?></label>
<input type="text" name="fragment" id="fragment" readonly>
<span id="linkfragment"></span>
</div>
<!-- img placeholder -->
<img style="display:none" src="" id="target">
</div>
<div id="footer">
<a href="https://github.com/lizfischer/iiif-tools" target="_blank">Liz Fischer</a>, 2016, forked by /* / */, <a href="cropper.zip">source</a> [zip file].
</div>
</body>
</html>