diff --git a/_imgur.js b/_imgur.js
index 65713c2..213c48b 100644
--- a/_imgur.js
+++ b/_imgur.js
@@ -12,6 +12,8 @@ document.body.insertAdjacentHTML
( 'afterbegin',
`
Alege imaginile de incarcat la imgur:
+
+
Optional, o descriere pt fiecare poza:
diff --git a/exif.js b/exif.js
index 02e6e0b..f216b91 100644
--- a/exif.js
+++ b/exif.js
@@ -25,10 +25,27 @@ function loaded(){
var filez=document.getElementById("filez");
var photoz= document.getElementById("photoz");
var forumtext= document.getElementById("forumtext");
+ var license = document.getElementById("ccbysa");
var nfiles=0;
document.getElementById("cpy").disabled=true;
+ var ccbysa_license_text = "\nImagine publicată sub licența [URL=https://creativecommons.org/licenses/by-sa/4.0/]Creative Commons Atribuire-Distribuire în Condiții identice 4.0[/URL]"
+
+ license.onchange=function(e){
+ var license_text = "";
+ if (license.checked)
+ license_text += ccbysa_license_text;
+ var cpy_state = document.getElementById("cpy").disabled;
+ document.getElementById("cpy").disabled = true;
+ for(var x = 0; x < idx; x++) {
+ document.getElementById('orig1_'+x).innerHTML= license_text;
+ }
+ document.getElementById("cpy").disabled=cpy_state;
+ };
filez.onchange=function(e){
+ var license_text = "";
+ if (license.checked)
+ license_text += ccbysa_license_text;
nfiles+= filez.files.length;
document.getElementById("cpy").disabled=true;
for (var x = 0; x < filez.files.length; x++) {
@@ -36,7 +53,7 @@ function loaded(){
photoz.innerHTML+= '
'+filez.files[x].name+'
';
document.getElementById('f_'+idx).innerHTML= "";
- forumtext.innerHTML+='\n[IMG][/IMG]\n\n';
+ forumtext.innerHTML+='\n[IMG][/IMG]'+license_text+'\n\n';
(function(n, fidx){
var fr= new FileReader();
@@ -65,7 +82,6 @@ function loaded(){
//Send the proper header information along with the request
http.setRequestHeader("authorization", "Client-ID 59c68e102e4b4fc");
-
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
var img=JSON.parse(http.responseText);
@@ -86,13 +102,11 @@ function loaded(){
var fd1 = new FormData();
- fd1.append("description", JSON.stringify(exif));
+ fd1.append("description", license_text + "\n" + JSON.stringify(exif));
http1.open("POST", url1, true);
//Send the proper header information along with the request
http1.setRequestHeader("authorization", "Client-ID 59c68e102e4b4fc");
-// http1.setRequestHeader("Cache-Control", "null");
-// http1.setRequestHeader("X-Requested-With", "null");
http1.onreadystatechange = function() {//Call a function when the state changes.
if(http1.readyState==4){
nfiles--;
@@ -119,7 +133,7 @@ function loaded(){
{
document.getElementById('i_'+n).innerHTML= imgRoot+'h'+imgExt;
document.getElementById('orig_'+n).innerHTML= '[URL='+img.data.link+']';
- document.getElementById('orig1_'+n).innerHTML= '[/URL]';
+ document.getElementById('orig1_'+n).innerHTML= '[/URL]' + license_text;
}
}
@@ -144,7 +158,6 @@ function loaded(){
// --header 'authorization: Client-ID 59c68e102e4b4fc'
}
-
const exifExample={
"Orientation":3,
"XResolution":72,