Mercurial > hg > fapweb
comparison admajax.js.php @ 1092:95b74632cfe2
Rename votekeys table to userkeys, and all related variables and settings.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Jan 2017 13:38:19 +0200 |
parents | 01783161eeb2 |
children | 0a2117349f46 |
comparison
equal
deleted
inserted
replaced
1091:c4b93729269d | 1092:95b74632cfe2 |
---|---|
617 jsDeleteItem(id, "entry", "entries", function() { refreshDispatchCM(cid); refreshEntryCompos(); }, "entry"); | 617 jsDeleteItem(id, "entry", "entries", function() { refreshDispatchCM(cid); refreshEntryCompos(); }, "entry"); |
618 } | 618 } |
619 | 619 |
620 | 620 |
621 // | 621 // |
622 // Votekey management | 622 // Userkey management |
623 // | 623 // |
624 function voteKeyInfoRefresh() | 624 function userKeyInfoRefresh() |
625 { | 625 { |
626 jsRefreshItems("vkeyInfo", "votekey", "info"); | 626 jsRefreshItems("vkeyInfo", "userkey", "info"); |
627 } | 627 } |
628 | 628 |
629 | 629 |
630 function voteKeyRefresh(id) | 630 function userKeyRefresh(id) |
631 { | 631 { |
632 var msuccess2 = function(txt) | 632 var msuccess2 = function(txt) |
633 { | 633 { |
634 var nitem = document.getElementById("vkey"+id); | 634 var nitem = document.getElementById("vkey"+id); |
635 if (nitem) | 635 if (nitem) |
636 nitem.className = txt; | 636 nitem.className = txt; |
637 voteKeyInfoRefresh(); | 637 userKeyInfoRefresh(); |
638 } | 638 } |
639 | 639 |
640 var msuccess1 = function(txt) | 640 var msuccess1 = function(txt) |
641 { | 641 { |
642 var nitem = document.getElementById("vkey"+id); | 642 var nitem = document.getElementById("vkey"+id); |
643 if (nitem) | 643 if (nitem) |
644 nitem.innerHTML = txt; | 644 nitem.innerHTML = txt; |
645 voteKeyInfoRefresh(); | 645 userKeyInfoRefresh(); |
646 } | 646 } |
647 | 647 |
648 jsSendPOSTRequest("action=get&type=votekey&id="+id, msuccess1); | 648 jsSendPOSTRequest("action=get&type=userkey&id="+id, msuccess1); |
649 jsSendPOSTRequest("action=get&type=votekeyclass&id="+id, msuccess2); | 649 jsSendPOSTRequest("action=get&type=userkeyclass&id="+id, msuccess2); |
650 } | 650 } |
651 | 651 |
652 | 652 |
653 function voteKeyUpdate(id, type, args) | 653 function userKeyUpdate(id, type, args) |
654 { | 654 { |
655 var msuccess = function(txt) | 655 var msuccess = function(txt) |
656 { | 656 { |
657 voteKeyRefresh(id); | 657 userKeyRefresh(id); |
658 voteKeyInfoRefresh(); | 658 userKeyInfoRefresh(); |
659 } | 659 } |
660 | 660 |
661 jsSendPOSTRequest("action=votekey&type="+type+"&id="+id+"&"+args, msuccess); | 661 jsSendPOSTRequest("action=userkey&type="+type+"&id="+id+"&"+args, msuccess); |
662 } | 662 } |
663 | 663 |
664 | 664 |
665 function voteKeySetActive(id) | 665 function userKeySetActive(id) |
666 { | 666 { |
667 var args = jsMakePostArgs({"active":3}, "vk", id); | 667 var args = jsMakePostArgs({"active":3}, "vk", id); |
668 | 668 |
669 var mcb_ok = function (data) | 669 var mcb_ok = function (data) |
670 { | 670 { |
671 voteKeyUpdate(id, "active", args); | 671 userKeyUpdate(id, "active", args); |
672 } | 672 } |
673 | 673 |
674 var mcb_cancel = function (data) | 674 var mcb_cancel = function (data) |
675 { | 675 { |
676 voteKeyRefresh(id); | 676 userKeyRefresh(id); |
677 } | 677 } |
678 | 678 |
679 if (lastPostArgs["active"] == 0) | 679 if (lastPostArgs["active"] == 0) |
680 jsConfirmBox("Are you sure you want to deactivate vote key #"+id+"?", mcb_ok, mcb_cancel, 0); | 680 jsConfirmBox("Are you sure you want to deactivate vote key #"+id+"?", mcb_ok, mcb_cancel, 0); |
681 else | 681 else |
682 mcb_ok(0); | 682 mcb_ok(0); |
683 } | 683 } |
684 | 684 |
685 | 685 |
686 function voteKeyAssign(id, mode) | 686 function userKeyAssign(id, mode) |
687 { | 687 { |
688 var args = jsMakePostArgs({"key_id":2}, "vk", id); | 688 var args = jsMakePostArgs({"key_id":2}, "vk", id); |
689 | 689 |
690 var mcb_ok = function (data) | 690 var mcb_ok = function (data) |
691 { | 691 { |
692 voteKeyUpdate(id, (mode ? "assign" : "clear"), args); | 692 userKeyUpdate(id, (mode ? "assign" : "clear"), args); |
693 } | 693 } |
694 | 694 |
695 if (mode == 0) | 695 if (mode == 0) |
696 jsConfirmBox("Are you sure you want to clear vote key assign #"+id+"?", mcb_ok, 0, 0); | 696 jsConfirmBox("Are you sure you want to clear vote key assign #"+id+"?", mcb_ok, 0, 0); |
697 else | 697 else |