5 Commits

Author SHA1 Message Date
K. Nobel
bcb01e3296 Merge branch 'master' into kevin-prototype 2017-02-03 13:22:59 +01:00
K. Nobel
7cc6450e6a Added comments to javascript code. 2017-02-03 13:19:00 +01:00
Lars van Hijfte
833bfd3292 Merge branch 'lars' into 'master'
Lars

See merge request !209
2017-02-03 12:42:15 +01:00
Marijn Jansen
1e60941a3f Merge branch 'marijn-favicon' into 'master'
Favicon

See merge request !207
2017-02-03 11:42:40 +01:00
Marijn Jansen
e3f4fa0b3c Favicon 2017-02-03 11:42:16 +01:00
32 changed files with 169 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="tiny.png"/>
<square150x150logo src="square.jpg"/>
<wide310x150logo src="wide.jpg"/>
<square310x310logo src="large.jpg"/>
<TileColor>#000000</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
website/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -1,6 +1,8 @@
// Show the right friendship buttonsto the user.
function placeFriendButtons() {
$.post("API/getFriendshipStatus.php", { usr: userID })
.done(function(data) {
//save the friendship status
var friendshipStatus = data;
var $buttonContainer = $("div.friend-button-container");
$("#start-profile-chat").hide();
@@ -22,6 +24,7 @@ function placeFriendButtons() {
text1 = "Word vrienden";
icon1 = "fa-user-plus";
break;
// Users are friends.
case "1":
value1 = userID;
class1 = "green";
@@ -32,12 +35,14 @@ function placeFriendButtons() {
text2 = "Ontvriend";
icon2 = "fa-user-times";
break;
// This user sent request.
case "2":
value1 = "delete";
class1 = "red";
text1 = "Trek verzoek in";
icon1 = "fa-times";
break;
// Other user sent request.
case "3":
value1 = "accept";
class1 = "green";
@@ -50,6 +55,7 @@ function placeFriendButtons() {
break;
}
// Append buttons to the container.
$buttonContainer.append(
"<div><button class='"+ class1 +" fancy-button friend-button' value='"+ value1 +"'>" +
"<span>"+ text1 +"</span>" +
@@ -61,7 +67,7 @@ function placeFriendButtons() {
"<i class='fa fa-fw "+ icon2 +"'></i> " +
"</button></div>");
// Gets triggered when a friend button is triggered.
$buttonContainer.find("button").click(function() {
if (isNaN(this.value))
editFriendship(userID, this.value);

View File

@@ -3,22 +3,28 @@ function placeGroupButtons() {
.done(function(data) {
var $buttonContainer = $("div.group-button-container");
if (data == 'none') {
// Append the right group button to the button container.
// When user is not a member
if(data == 'none') {
$buttonContainer.append(
"<button class='green group-button fancy-button' value='request'>" +
"<span>Treed toe</span><i class='fa fa-plus'></i>" +
"</button>");
} else if (data == 'request') {
// when user sent a request to become a member.
} else if(data == 'request') {
$buttonContainer.append(
"<button class='red group-button fancy-button' value='none'>" +
"<span>Trek verzoek in</span><i class='fa fa-times'></i>" +
"</button>");
// When user is a member of the group.
} else if (data == 'admin') {
$buttonContainer.append(
"<button class='group-button fancy-button' value='admin'>" +
"<span>Instellingen</span><i class='fa fa-cogs'></i>" +
"</button>"
);
} else {
$buttonContainer.append(
"<button class='red group-button fancy-button' value='none'>" +
@@ -26,6 +32,7 @@ function placeGroupButtons() {
"</button>");
}
// Gets triggered when a group button is clicked.
$buttonContainer.children().click(function() {
if (this.value == 'admin') {
window.location.href='groupAdmin.php?groupID=' + groupID;

View File

@@ -1,3 +1,4 @@
// Vertical margin between two posts.
margin = 20;
// scrolling modal taken from http://stackoverflow.com/questions/10476632/how-to-scroll-the-page-when-a-modal-dialog-is-longer-than-the-screen
@@ -11,9 +12,12 @@ function scrollbarMargin(width, overflow) {
});
}
// Get post from the server.
function requestPost(postID) {
// Make the modal view visible.
$(".modal").show();
// Send get request to the server to load the post.
$.get("API/loadPost.php", { postID : postID }).done(function(data) {
$('.modal-default').hide();
var scrollBarWidth = window.innerWidth - document.body.offsetWidth;
@@ -23,11 +27,14 @@ function requestPost(postID) {
});
}
// Create a new post.
function postPost() {
title = $("input.newpost[name='title']").val();
content = $("textarea.newpost[name='content']").val();
console.log(masonryMode);
// Masonrymode 2: when on group page and user is an admin.
if (masonryMode == 2) {
// Create the new group post.
$.post("API/postPost.php", { title: title,
content : content,
group : groupID })
@@ -46,6 +53,7 @@ function postPost() {
}
});
} else {
// Create the new user post.
$.post("API/postPost.php", { title: title,
content : content })
.done(function(data) {
@@ -76,6 +84,7 @@ var postAmount = 0;
var noposts = false;
$(document).ready(function () {
// Initialise variables for masonry.
windowWidth = $(window).width();
columnCount = Math.floor($(".posts").width() / 250);
columns = new Array(columnCount);
@@ -86,6 +95,7 @@ $(window).on("load", function() {
$(".modal-close").click(function (){closeModal()});
// http://stackoverflow.com/questions/9439725/javascript-how-to-detect-if-browser-window-is-scrolled-to-bottom
// Infinite scroll.
window.onscroll = function(ev) {
if($(window).scrollTop() + $(window).height() == $(document).height() ) {
loadMorePosts(userID, groupID, postAmount, postLimit);
@@ -108,6 +118,7 @@ $(window).on("load", function() {
});
// Hide modal view from the screen.
function closeModal() {
$(".modal").hide();
scrollbarMargin(0, 'auto');
@@ -115,23 +126,30 @@ function closeModal() {
$('.modal-default').show();
}
// Will fire when user resizes the window.
$(window).resize(function() {
clearTimeout(window.resizedFinished);
window.resizeFinished = setTimeout(function() {
// Check if the width of the screen changed.
if ($(window).width() != windowWidth) {
// Save width.
windowWidth = $(window).width();
// Check if there fit more or less columns in the new width.
if (columnCount != Math.floor($(".posts").width() / 250)) {
columnCount = Math.floor($(".posts").width() / 250);
// Respawn the masonry grid.
masonry(masonryMode);
}
}
}, 250);
});
// Select the container for masonry.
var $container = $(".posts");
// Spawn the masonry grid.
function masonry(mode) {
// save the masonry mode.
masonryMode = mode;
$container.children().remove();
@@ -139,10 +157,7 @@ function masonry(mode) {
noposts = false;
postAmount = 0;
/*
* Initialise columns.
*/
// Initialise columns.
for (i = 0; i < columnCount; i++) {
$column = $("<div class=\"column\">");
$column.width(100/columnCount + "%");
@@ -150,11 +165,13 @@ function masonry(mode) {
columns[i] = [0, $column];
}
// Place the form for new posts.
if(mode > 0) {
$postInput = $("<div class=\"post platform\">");
$form = $("<form class=\"newpost\" action=\"API/postPost.php\" method=\"post\" onsubmit=\"postPost(); return false;\">");
$postInput.append($form);
//Add extra input for group posts.
if(mode == 2) {
$form.append($("<input class=\"newpost\" type=\"hidden\" name=\"group\" value=\"" + groupID + "\">"));
}
@@ -167,17 +184,11 @@ function masonry(mode) {
columns[0][0] = $postInput.height() + margin;
}
/*
* Function will find the column with the shortest height.
*/
/*
* Get the posts from the server.
*/
// Get the posts from the server.
loadMorePosts(userID, groupID, 0, postLimit);
}
// Find the column with the shortest hight.
function getShortestColumn(columns) {
column = columns[0];
@@ -189,17 +200,20 @@ function getShortestColumn(columns) {
return column;
}
// Load certain range of posts.
function loadMorePosts(uID, gID, offset, limit) {
if (noposts) {
return;
}
// Get a list of posts from the server.
$.post("API/getPosts.php", { usr : uID,
grp : gID,
offset : offset,
limit : limit})
.done(function(data) {
if (!data) {
// No posts were found, show noposts bar to user.
$('.noposts').show();
noposts = true;
return;
@@ -207,9 +221,7 @@ function loadMorePosts(uID, gID, offset, limit) {
posts = JSON.parse(data);
/*
* Rearange the objects.
*/
// Rearange the objects.
$.each(posts, function() {
$post = $("<div class=\"post platform\" onclick=\"requestPost(\'"+this['postID']+"\')\">");
$post.append($("<h2>").html(this["title"]));

BIN
website/public/large.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

44
website/public/manifest.json Executable file
View File

@@ -0,0 +1,44 @@
{
"name": "Web Application Manifest Sample",
"icons": [
{
"src": "launcher-icon-0-75x.png",
"sizes": "36x36",
"type": "image/png",
"density": "0.75"
},
{
"src": "launcher-icon-1x.png",
"sizes": "48x48",
"type": "image/png",
"density": "1.0"
},
{
"src": "launcher-icon-1-5x.png",
"sizes": "72x72",
"type": "image/png",
"density": "1.5"
},
{
"src": "launcher-icon-2x.png",
"sizes": "96x96",
"type": "image/png",
"density": "2.0"
},
{
"src": "launcher-icon-3x.png",
"sizes": "144x144",
"type": "image/png",
"density": "3.0"
},
{
"src": "launcher-icon-4x.png",
"sizes": "192x192",
"type": "image/png",
"density": "4.0"
}
],
"start_url": "index.html",
"display": "standalone",
"orientation": "portrait"
}

BIN
website/public/square.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
website/public/tiny.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
website/public/wide.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -2,6 +2,40 @@
<meta name="description" content="MyHyvesbook+ is het sociaal medium voor alle coole mensen. Stap nu over van facebook op het gloednieuwe en betere sociaal medium.">
<meta name="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
<meta name="author" content="MyHyvesbookplus corporation">
<!--Favicon-->
<!-- Desktop Browsers -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<!-- Android: Chrome M39 and up-->
<link rel="manifest" href="manifest.json">
<!-- Android: Chrome M31 and up, ignored if manifest is present-->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="icon-192x192.png">
<!-- iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="My Awesome Web App">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180-precomposed.png">
<link href="apple-touch-icon-152x152-precomposed.png" sizes="152x152" rel="apple-touch-icon">
<link href="apple-touch-icon-144x144-precomposed.png" sizes="144x144" rel="apple-touch-icon">
<link href="apple-touch-icon-120x120-precomposed.png" sizes="120x120" rel="apple-touch-icon">
<link href="apple-touch-icon-114x114-precomposed.png" sizes="114x114" rel="apple-touch-icon">
<link href="apple-touch-icon-76x76-precomposed.png" sizes="76x76" rel="apple-touch-icon">
<link href="apple-touch-icon-72x72-precomposed.png" sizes="72x72" rel="apple-touch-icon">
<link href="apple-touch-icon-60x60-precomposed.png" sizes="60x60" rel="apple-touch-icon">
<link href="apple-touch-icon-57x57-precomposed.png" sizes="57x57" rel="apple-touch-icon">
<link href="apple-touch-icon-precomposed.png" rel="apple-touch-icon">
<!-- Windows 8 and IE 11 -->
<meta name="msapplication-config" content="browserconfig.xml" />
<!-- Windows -->
<meta name="application-name" content="My Awesome Web App" />
<meta name="msapplication-tooltip" content="Get the latest updates!" />
<meta name="msapplication-window" content="width=1024;height=768" />
<meta name="msapplication-navbutton-color" content="#FF3300" />
<meta name="msapplication-starturl" content="./" />
<title>MyHyvesbook+</title>
<!-- Add your javascript files here. -->
<script src="js/jquery.js"></script>

View File

@@ -3,6 +3,40 @@
<meta name="description" content="MyHyvesbook+ is het sociaal medium voor alle coole mensen. Stap nu over van facebook op het gloednieuwe en betere sociaal medium.">
<meta name="keywords" content="MyHyvesbookPlus,Myhyvesbook+,sociaal,media">
<meta name="author" content="MyHyvesbookplus corporation">
<!-- Favicon-->
<!-- Desktop Browsers -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<!-- Android: Chrome M39 and up-->
<link rel="manifest" href="manifest.json">
<!-- Android: Chrome M31 and up, ignored if manifest is present-->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="icon-192x192.png">
<!-- iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="My Awesome Web App">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon-180x180-precomposed.png">
<link href="apple-touch-icon-152x152-precomposed.png" sizes="152x152" rel="apple-touch-icon">
<link href="apple-touch-icon-144x144-precomposed.png" sizes="144x144" rel="apple-touch-icon">
<link href="apple-touch-icon-120x120-precomposed.png" sizes="120x120" rel="apple-touch-icon">
<link href="apple-touch-icon-114x114-precomposed.png" sizes="114x114" rel="apple-touch-icon">
<link href="apple-touch-icon-76x76-precomposed.png" sizes="76x76" rel="apple-touch-icon">
<link href="apple-touch-icon-72x72-precomposed.png" sizes="72x72" rel="apple-touch-icon">
<link href="apple-touch-icon-60x60-precomposed.png" sizes="60x60" rel="apple-touch-icon">
<link href="apple-touch-icon-57x57-precomposed.png" sizes="57x57" rel="apple-touch-icon">
<link href="apple-touch-icon-precomposed.png" rel="apple-touch-icon">
<!-- Windows 8 and IE 11 -->
<meta name="msapplication-config" content="browserconfig.xml" />
<!-- Windows -->
<meta name="application-name" content="My Awesome Web App" />
<meta name="msapplication-tooltip" content="Get the latest updates!" />
<meta name="msapplication-window" content="width=1024;height=768" />
<meta name="msapplication-navbutton-color" content="#FF3300" />
<meta name="msapplication-starturl" content="./" />
<title>MyHyvesbook+</title>
<link rel="stylesheet"
type="text/css"