X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;ds=sidebyside;f=js%2FpageAdmin.js;h=d7a14be15f23f413e4fbd0eb4beac8a9f0c462a1;hb=28cbabecbfc2e05861779a19e5a75bddbc0ad416;hp=4c34f58c43341c750c865ec4d797c8456d69ef2c;hpb=a2f6d159387e456847fb4e7607b4663ab8fa94fc;p=euphorik.git
diff --git a/js/pageAdmin.js b/js/pageAdmin.js
index 4c34f58..d7a14be 100644
--- a/js/pageAdmin.js
+++ b/js/pageAdmin.js
@@ -13,10 +13,15 @@ PageAdmin.prototype.contenu = function()
{
return '
Chaque semaine un troll est choisit au hasard parmis les trolls proposés et devient le troll de la semaine.
\
- ' +
- '
' + thisTrolls.formateur.traitementComplet(data["trolls"][i]["content"], data["trolls"][i]["author"]) + '' +
- '
' + thisTrolls.formateur.traitementComplet(data["trolls"][i]["author"]) + '' +
+ '
' +
+ '' + thisTrolls.formateur.traitementComplet(troll.content, troll.author) + '' +
+ ' - ' + thisTrolls.formateur.traitementComplet(troll.author) + '' +
(data["trolls"][i]["author_id"] == thisTrolls.client.id ? 'éditerSupprimer' : '') +
'
'
}
@@ -187,6 +273,16 @@ Trolls.prototype.rafraichirTrolls = function()
{
var troll = this
var id = parseInt($(this).attr("id").substr(5))
+
+ $("a[@rel*=lightbox]", this).lightBox()
+
+ $(this).keypress(
+ function(e)
+ {
+ if (e.which == 13) // return
+ $(".modifier", this).click()
+ }
+ )
$(".delTroll", this).click(
function()
{
@@ -208,12 +304,16 @@ Trolls.prototype.rafraichirTrolls = function()
{
$("span", troll).css("display", "none")
$(troll).append(
- '
'
+ '
'
)
+ $("form input.content").focus()
+
var virerLeFormulaire = function()
{
$("form", troll).remove()
- $("span", troll).css("display", "inline")
+ $('span', troll).css("display", "inline")
}
$("span.modifier", troll).click(
function()
@@ -234,11 +334,16 @@ Trolls.prototype.rafraichirTrolls = function()
thisTrolls.dernierTroll = data["trolls"][data["trolls"].length - 1]["troll_id"]
break
case "troll_modified" :
- $("#trolls #troll" + data["troll_id"] + " .content").html(data["content"])
+ $("#trolls #troll" + data["troll_id"] + " .content").html(thisTrolls.formateur.traitementComplet(data["content"], thisTrolls.trolls[data["troll_id"]].author))
+ $("#trolls #troll" + data["troll_id"] + " a[@rel*=lightbox]").lightBox()
+ thisTrolls.trolls[data["troll_id"]].content = data["content"]
break
case "troll_deleted" :
$("#trolls #troll"+data["troll_id"]).remove()
break
+ case "error" :
+ thisTrolls.util.messageDialogue(data["error_message"])
+ break
}
}
)