From dd2feab740cd60f96d2a3ac6309d53cf6906509e Mon Sep 17 00:00:00 2001 From: Nael Date: Sat, 8 Mar 2014 02:37:16 +0100 Subject: [PATCH] menu for list. not working though. strange bug in js --- uVote/page/default_page/js/loadtexts.js | 81 +++++++++----- uVote/page/default_page/loginform.tpl | 1 - uVote/page/default_page/page.tpl | 4 +- uVote/page/page_uvote.php | 5 +- uVote/page/register_page_classes.php | 5 +- uVote/page/user_list/list_menu.tpl | 11 ++ uVote/page/user_list/user_list.php | 15 +++ uVote/page/user_list_active/active.tpl | 1 + .../user_list_active/user_list_active.php | 105 ++++++++++++++++++ uVote/page/user_list_ended/ended.tpl | 1 + .../page/user_list_ended/user_list_ended.php | 103 +++++++++++++++++ 11 files changed, 298 insertions(+), 34 deletions(-) create mode 100644 uVote/page/user_list/list_menu.tpl create mode 100644 uVote/page/user_list/user_list.php create mode 100644 uVote/page/user_list_active/active.tpl create mode 100644 uVote/page/user_list_active/user_list_active.php create mode 100644 uVote/page/user_list_ended/ended.tpl create mode 100644 uVote/page/user_list_ended/user_list_ended.php diff --git a/uVote/page/default_page/js/loadtexts.js b/uVote/page/default_page/js/loadtexts.js index 368d2c2..04fa820 100644 --- a/uVote/page/default_page/js/loadtexts.js +++ b/uVote/page/default_page/js/loadtexts.js @@ -6,12 +6,7 @@ $(document).ready(function() { //loadUrlPic($(this).attr('url')); });*/ - $('.btn_vote').click(function () { - //vote_click($(this).attr('poll_ID')); - $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); - open_vote($(this).attr('poll_ID')); - register_registerform(); - }); + /*$('.btn_openvoteinfo').click(function () { @@ -23,9 +18,43 @@ $(document).ready(function() { });*/ //jqBootstrapValidation - + - $("#form_login input").not("[type=submit]").jqBootstrapValidation({ + $('#user_main').load('./?action=user_main', function(){ + register_registerform(); + $('#feedback_submit').click(function (data){ + var test = $('textarea#feedback_text').val(); + send_feedback(test); + + }); + $('#tabs_user_main a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + load_user_main_tab($(this).attr('action')); + }); + + //load_user_main_tab('user_main_uVote'); + }); + + $('#user_list').load('./?action=user_list', function(){ + $('.btn_vote').click(function () { + //vote_click($(this).attr('poll_ID')); + $('#user_main').load('./?action=open_bulletin&poll_ID=' + $(this).attr('poll_ID')); + open_vote($(this).attr('poll_ID')); + register_registerform(); + }); + $('#tabs_user_list a').click(function (e) { + e.preventDefault(); + $(this).tab('show'); + load_user_list_tab($(this).attr('action')); + }); + + //load_user_main_tab('user_main_uVote'); + }); + +}); +$("#form_login input").not("[type=submit]").jqBootstrapValidation({ + preventSubmit: true, submitError: function($form, event, errors) {}, submitSuccess: function($form, event){ @@ -52,25 +81,8 @@ $(document).ready(function() { } }); - $('#user_main').load('./?action=user_main', function(){ - register_registerform(); - $('#feedback_submit').click(function (data){ - var test = $('textarea#feedback_text').val(); - send_feedback(test); - - }); - $('#tabs_user_main a').click(function (e) { - e.preventDefault(); - $(this).tab('show'); - load_user_main_tab($(this).attr('action')); - }); - - //load_user_main_tab('user_main_uVote'); - }); - -}); - function register_registerform(){ + console.log("wegwegwegwegwegweg"); $("#register_user_form input").not("[type=submit]").jqBootstrapValidation( { preventSubmit: true, @@ -97,7 +109,6 @@ function load_user_main_tab(action){ switch(action){ case 'user_main_uVote': - window.location.reload(); $('#tab_uVote').load('./?action='+ action); return; case 'user_main_urVote': @@ -114,7 +125,19 @@ function load_user_main_tab(action){ default: } } - +function load_user_list_tab(action){ + + switch(action){ + + case 'user_list_active': + $('#tab_active').load('./?action='+ action); + return; + case 'user_list_ended': + $('#tab_ended').load('./?action='+ action); + return; + default: + } +} function account_create(inputEmail, inputPassword){ $.get('./api.php?call=account&action=create&username=' + NULL + '&password_sha=' + password + '&email=' + email + '&locale=deDE', function (data) { @@ -211,7 +234,7 @@ $.ajax({ } function open_vote (poll_ID) { - $('#list').load('./api.php?call=vote&action=open_vote&poll_ID=' + poll_ID, function(){ + $('#user_list').load('./api.php?call=vote&action=open_vote&poll_ID=' + poll_ID, function(){ $('.btnvote_yes').click(function () { vote_click($(this).attr('poll_ID'),1); }); diff --git a/uVote/page/default_page/loginform.tpl b/uVote/page/default_page/loginform.tpl index b98d11c..750d197 100644 --- a/uVote/page/default_page/loginform.tpl +++ b/uVote/page/default_page/loginform.tpl @@ -3,7 +3,6 @@ --> -