Mercurial > hg > fapweb
comparison admin.js @ 1038:2e1a9b564674
Add votekey information blurb.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 20 Nov 2015 08:38:38 +0200 |
parents | df54d73bc5a0 |
children | f188caaedf0f |
comparison
equal
deleted
inserted
replaced
1037:df54d73bc5a0 | 1038:2e1a9b564674 |
---|---|
534 | 534 |
535 | 535 |
536 // | 536 // |
537 // Votekey management | 537 // Votekey management |
538 // | 538 // |
539 function voteKeyInfoRefresh() | |
540 { | |
541 jsRefreshItems("vkeyInfo", "votekey", "info"); | |
542 } | |
543 | |
544 | |
539 function voteKeyRefresh(id) | 545 function voteKeyRefresh(id) |
540 { | 546 { |
541 var msuccess2 = function(txt) | 547 var msuccess2 = function(txt) |
542 { | 548 { |
543 var nitem = document.getElementById("vkey"+id); | 549 var nitem = document.getElementById("vkey"+id); |
544 if (nitem) | 550 if (nitem) |
545 nitem.className = txt; | 551 nitem.className = txt; |
552 voteKeyInfoRefresh(); | |
546 } | 553 } |
547 | 554 |
548 var msuccess1 = function(txt) | 555 var msuccess1 = function(txt) |
549 { | 556 { |
550 var nitem = document.getElementById("vkey"+id); | 557 var nitem = document.getElementById("vkey"+id); |
551 if (nitem) | 558 if (nitem) |
552 nitem.innerHTML = txt; | 559 nitem.innerHTML = txt; |
560 voteKeyInfoRefresh(); | |
553 } | 561 } |
554 | 562 |
555 jsSendPOSTRequest("action=get&type=votekey&id="+id, msuccess1); | 563 jsSendPOSTRequest("action=get&type=votekey&id="+id, msuccess1); |
556 jsSendPOSTRequest("action=get&type=votekeyclass&id="+id, msuccess2); | 564 jsSendPOSTRequest("action=get&type=votekeyclass&id="+id, msuccess2); |
557 } | 565 } |
560 function voteKeyUpdate(id, type, args) | 568 function voteKeyUpdate(id, type, args) |
561 { | 569 { |
562 var msuccess = function(txt) | 570 var msuccess = function(txt) |
563 { | 571 { |
564 voteKeyRefresh(id); | 572 voteKeyRefresh(id); |
573 voteKeyInfoRefresh(); | |
565 } | 574 } |
566 | 575 |
567 jsSendPOSTRequest("action=votekey&type="+type+"&id="+id+"&"+args, msuccess); | 576 jsSendPOSTRequest("action=votekey&type="+type+"&id="+id+"&"+args, msuccess); |
568 } | 577 } |
569 | 578 |