diff --git a/website/public/API/edit_friendship.php b/website/public/API/edit_friendship.php deleted file mode 100644 index 52aacf5..0000000 --- a/website/public/API/edit_friendship.php +++ /dev/null @@ -1,31 +0,0 @@ -fetchAll(PDO::FETCH_ASSOC); + +for($i = 0; $i < sizeof($results); $i++) { + $results[$i]["nicetime"] = nicetime($results[$i]["creationdate"]); +} + +//$results[0]["niceTime"] = nicetime($results[0]["creationdate"]); + +echo json_encode($results); \ No newline at end of file diff --git a/website/public/API/postComment.php b/website/public/API/postComment.php new file mode 100644 index 0000000..b840e0b --- /dev/null +++ b/website/public/API/postComment.php @@ -0,0 +1,18 @@ + $friend) { $friendshipStatus = getFriendshipStatus($friend->userID); - - if ($limit != 0 && $i >= $limit) - $extra = "extra-friend-item"; - else - $extra = ""; ?>
  • @@ -60,15 +49,13 @@ foreach($friends as $i => $friend) {
    1) { + if ($friendshipStatus == 2) { + $denyName = "Annuleer"; + } else { + $denyName = "Weiger"; + } ?> -
    - - +
    @@ -76,11 +63,19 @@ foreach($friends as $i => $friend) { onclick="editFriendship('userID ?>', 'accept')" class='accept-notification' value='1'> - + Accepteer + +
    $friend) { $limit) { - ?> -
  • - Meer vrienden... -
  • - diff --git a/website/public/bits/group-item.php b/website/public/bits/group-item.php index 0a5831c..92eccfc 100644 --- a/website/public/bits/group-item.php +++ b/website/public/bits/group-item.php @@ -22,17 +22,3 @@ foreach($groups as $i => $group) { -
  • -
    - - - -
    -
  • diff --git a/website/public/js/header.js b/website/public/js/header.js index 8d91d95..9889bdb 100644 --- a/website/public/js/header.js +++ b/website/public/js/header.js @@ -1,25 +1,19 @@ $(document).ready(function() { - $("#own-profile-picture").click(function() { - if($("#notification-center").css('right') == "-256px") { - $(".content").animate({ - marginRight: "256px" - }, 500); - $(".chat-right").animate({ - width: $(".chat-right").width() - 266 - }, 500); - $("#notification-center").animate({ - right: "0px" - }, 500); + + // Toggle menu + $("#own-profile-picture, #open-notifications").click(function() { + if ($("#notification-center").css('right') == "-256px") { + // Make the menu visible and move the content to the left. + $("#chat-history").width("calc(100% - 587px)"); + $(".modal").width("calc(100% - 512px)"); + $(".content").css("margin-right", "256px"); + $("#notification-center").css("right", "0px"); } else { - $(".chat-right").animate({ - width: $(".chat-right").width() + 266 - }, 500); - $(".content").animate({ - marginRight: "0px" - }, 500); - $("#notification-center").animate({ - right: "-256px" - }, 500); + // Make the menu invisible and move the content to the right. + $("#chat-history").width("calc(100% - 331px)"); + $(".modal").width("calc(100% - 256px)"); + $(".content").css("margin-right", "0px"); + $("#notification-center").css("right", "-256px"); } }); }); diff --git a/website/public/js/masonry.js b/website/public/js/masonry.js index 3b872ba..7f6423e 100644 --- a/website/public/js/masonry.js +++ b/website/public/js/masonry.js @@ -11,12 +11,10 @@ function scrollbarMargin(width, overflow) { }); } -function requestPost(post) { +function requestPost(postID) { $(".modal").show(); - $.get( - "API/loadPost.php", - $(post).children("form").serialize() - ).done(function (data) { + + $.get("API/loadPost.php", { postID : postID }).done(function(data) { $('.modal-default').hide(); var scrollBarWidth = window.innerWidth - document.body.offsetWidth; scrollbarMargin(scrollBarWidth, 'hidden'); @@ -26,37 +24,55 @@ function requestPost(post) { } $(window).on("load", function() { - console.log("LOADED"); - container = $("div.posts"); - posts = container.children(); - posts.remove(); - - column = $('
    ').append(posts); - container.append(column); - - mansonry(); - mansonry(); + $(".modal-close").click(function () { + $(".modal").hide(); + scrollbarMargin(0, 'auto'); + $('#modal-response').hide(); + $('.modal-default').show(); + }); }); +var masonryMode = 0; + $(window).resize(function() { clearTimeout(window.resizedFinished); window.resizeFinished = setTimeout(function() { - mansonry(); + masonry(masonryMode); }, 250); }); -function mansonry() { +var $container = $(".posts"); +function masonry(mode) { + masonryMode = mode; + $container.children().remove(); columnCount = Math.floor($(".posts").width() / 250); - console.log("columns: " + columnCount); /* * Initialise columns. */ var columns = new Array(columnCount); + var $columns = new Array(columnCount); for (i = 0; i < columnCount; i++) { - columns[i] = [0, []]; - console.log(columns[i]); + $column = $("
    "); + $column.width(100/columnCount + "%"); + $container.append($column); + columns[i] = [0, $column]; + } + + if(mode == 1) { + $postInput = $("
    "); + $form = $("
    "); + $postInput.append($form); + + $form.append($("")); + $form.append($("
    + + +
    diff --git a/website/views/profile.php b/website/views/profile.php index 4f7a115..54f028d 100644 --- a/website/views/profile.php +++ b/website/views/profile.php @@ -5,7 +5,7 @@
    - +

    @@ -43,37 +43,7 @@
    - -
    -
    - - - -
    -
    - fetch()) { - $nicetime = nicetime($post["creationdate"]); - $postID = $post["postID"]; - echo " -
    -

    ${post["title"]}

    -

    ${post["content"]}

    -

    ${nicetime} geplaatst.

    -
    - -
    -
    - "; - } - ?>
    @@ -131,28 +110,12 @@ $group_count = countSomeGroups($search)->fetchColumn(); ?> -