Skip to content
Extraits de code Groupes Projets
Valider 81047877 rédigé par renato's avatar renato
Parcourir les fichiers

fix the customized thumbnails upload interface

parent e8cf9ebc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -62,29 +62,37 @@ jQuery.fn.async_upload = function(add_function) { ...@@ -62,29 +62,37 @@ jQuery.fn.async_upload = function(add_function) {
function async_upload_article_edit(res,jForm){ function async_upload_article_edit(res,jForm){
var cont; var cont;
//add a class to new documents //verify if a new document or a customized vignette
res. var anchor = $(res.find(">a:first"));
find(">div[@class]") res.end();
.addClass("documents_added") if($("#"+anchor.id()).size()) {
.css("display","none") cont = $("#"+anchor.id()).next().next().html(anchor.next().next().html());
.end(); } else {
if (jForm.find("input[@name='arg']").val().search("vignette")!=-1) //add a class to new documents
cont = $("#liste_images"); res.
else find(">div[@class]")
cont = $("#liste_documents"); .addClass("documents_added")
cont .css("display","none")
.prepend(res.html()); .end();
//find added documents, remove label and show them nicely if (jForm.find("input[@name='arg']").val().search("/0/vignette")!=-1)
cont. cont = $("#liste_images");
find("div.documents_added") else
.removeClass("documents_added") cont = $("#liste_documents");
.show("slow",function(){ cont
var anim = $(this).css("height",""); .prepend(res.html());
//bug explorer-opera-safari //find added documents, remove label and show them nicely
if(!jQuery.browser.mozilla) anim.width(this.orig.width-2); cont.
$(anim).find("img[@onclick]").get(0).onclick(); find("div.documents_added")
}) .removeClass("documents_added")
.overflow(""); .show("slow",function(){
var anim = $(this).css("height","");
//bug explorer-opera-safari
if(!jQuery.browser.mozilla) anim.width(this.orig.width-2);
$(anim).find("img[@onclick]").get(0).onclick();
})
.overflow("");
}
$("form.form_upload",cont).async_upload(async_upload_article_edit);
verifForm(cont); verifForm(cont);
return true; return true;
} }
......
...@@ -130,9 +130,11 @@ function vignette_formulaire_legender($id_document, $document, $script, $type, $ ...@@ -130,9 +130,11 @@ function vignette_formulaire_legender($id_document, $document, $script, $type, $
$id_vignette = $document['id_vignette']; $id_vignette = $document['id_vignette'];
$texte = _T('info_supprimer_vignette'); $texte = _T('info_supprimer_vignette');
if (preg_match('/_edit$/', $script)) if (preg_match('/_edit$/', $script)) {
$iframe_redirect = generer_url_ecrire("documents_colonne","id=$id&type=$type",true);
$action = redirige_action_auteur('supprimer', "document-$id_vignette", $script, "id_$type=$id&show_docs=$id_document#$ancre"); $action = redirige_action_auteur('supprimer', "document-$id_vignette", $script, "id_$type=$id&show_docs=$id_document#$ancre");
else { } else {
$iframe_redirect = generer_url_ecrire("documenter","id_$type=$id&type=$type",true);
$s = ($ancre =='documents' ? '': '-'); $s = ($ancre =='documents' ? '': '-');
$action = ajax_action_auteur('documenter', "$s$id/$type/$id_vignette", $script, "id_$type=$id&type=$type&s=$s&show_docs=$id_document#$ancre", array($texte),'',"function(r,noeud) {noeud.innerHTML = r; \$('.form_upload',noeud).async_upload(async_upload_portfolio_documents);}"); $action = ajax_action_auteur('documenter', "$s$id/$type/$id_vignette", $script, "id_$type=$id&type=$type&s=$s&show_docs=$id_document#$ancre", array($texte),'',"function(r,noeud) {noeud.innerHTML = r; \$('.form_upload',noeud).async_upload(async_upload_portfolio_documents);}");
} }
...@@ -141,7 +143,7 @@ function vignette_formulaire_legender($id_document, $document, $script, $type, $ ...@@ -141,7 +143,7 @@ function vignette_formulaire_legender($id_document, $document, $script, $type, $
return "<hr style='margin-left: -5px; margin-right: -5px; height: 1px; border: 0px; color: #eeeeee; background-color: white;' />" return "<hr style='margin-left: -5px; margin-right: -5px; height: 1px; border: 0px; color: #eeeeee; background-color: white;' />"
. (!$id_vignette . (!$id_vignette
? $joindre($script, "id_$type=$id",$id, _T('info_vignette_personnalisee'), 'vignette', $type, $ancre, $id_document,generer_url_ecrire("documenter","id_$type=$id&type=$type",true)) ? $joindre($script, "id_$type=$id",$id, _T('info_vignette_personnalisee'), 'vignette', $type, $ancre, $id_document,$iframe_redirect)
: icone_horizontale($texte, $action, "vignette-24.png", "supprimer.gif", false)); : icone_horizontale($texte, $action, "vignette-24.png", "supprimer.gif", false));
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter