Added comments to javascript code #215

Merged
11319801 merged 65 commits from kevin-prototype into master 2017-02-03 21:19:51 +01:00
4 changed files with 66 additions and 19 deletions
Showing only changes of commit bf298f4b43 - Show all commits

View File

@@ -3,31 +3,41 @@ function placeGroupButtons() {
.done(function(data) {
var $buttonContainer = $("div.group-button-container");
if(data == 'none') {
if (data == 'none') {
$buttonContainer.append(
"<button class='green group-button' value='request'>" +
"<button class='green group-button group-button-fixed' value='request'>" +
"<i class='fa fa-plus'></i> Voeg toe" +
"</button>");
} else if(data == 'request') {
} else if (data == 'request') {
$buttonContainer.append(
"<button class='red group-button' value='none'>" +
"<button class='red group-button group-button-fixed' value='none'>" +
"<i class='fa fa-times'></i> Trek verzoek in" +
"</button>");
} else if (data == 'admin') {
$buttonContainer.append(
"<button class='group-button group-button-fancy' value='admin'>" +
"<span>Instellingen</span><i class='fa fa-cogs'></i>" +
"</button>"
);
} else {
$buttonContainer.append(
"<button class='red group-button' value='none'>" +
"<i class='fa fa-times'></i> Verlaat groep" +
"<button class='red group-button group-button-fancy' value='none'>" +
"<span>Verlaat groep</span><i class='fa fa-sign-out'></i>" +
"</button>");
}
$buttonContainer.children().click(function() {
$.post("API/editMembership.php", { grp: groupID, role: this.value })
.done(function() {
$buttonContainer.children().remove();
placeGroupButtons();
updateMenus();
}).fail(function() {
});
if (this.value == 'admin') {
window.location.href='groupAdmin.php?groupID=' + groupID;
} else {
$.post("API/editMembership.php", {grp: groupID, role: this.value})
.done(function () {
$buttonContainer.children().remove();
placeGroupButtons();
updateMenus();
}).fail(function () {
});
}
});
});

View File

@@ -91,7 +91,6 @@
.deleteButton {
background-color: firebrick;
}
.deleteButton i {

View File

@@ -31,11 +31,14 @@
display: block;
margin: 7px 0;
width: 200px;
font-size: 18px;
}
.friend-button-container button, .status-buttons-container button, .group-button-fixed {
width: 200px;
}
.group-button-container button {
float: right;
}
@@ -74,6 +77,22 @@
margin-right: 15px;
}
.group-button-fancy span {
display: none;
}
.group-button-fancy:hover {
text-align: right;
}
.group-button-fancy i {
display: inline-block;
}
.group-button-fancy:hover span {
display: inline-block;
margin-right: 5px;
}
/* Old */

View File

@@ -7,10 +7,20 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
<div class="content">
<div class="settings">
<?php if ($_SERVER["REQUEST_METHOD"] == "POST"): ?>
<div class='platform settings-message <?=$alertClass?>'>
<?=$alertMessage?>
</div>
<div class='platform settings-message <?=$alertClass?>'>
<?=$alertMessage?>
</div>
<?php endif; ?>
<div class="platform">
<ul>
<li>
<label></label>
<a href="group.php?groupname=<?=$groupinfo["name"]?>">
<button class="fa fa-chevron-left"> Terug naar de groep</button>
</a>
</li>
</ul>
</div>
<form class="platform" method="post">
<h5>Groep Instellingen</h5>
<input type="hidden" name="groupID" value="<?=$_GET["groupID"]?>">
@@ -70,9 +80,18 @@ $groupinfo = getGroupSettings($_GET["groupID"]);
<button type="submit"
name="form"
value="picture"
>Verander profielfoto</button>
class="fa fa-picture-o"
> Verander profielfoto</button>
</li>
</ul>
</form>
<div class="platform">
<ul>
<li>
<label></label>
<a href="group.php?groupname=<?=$groupinfo["name"]?>"><button class="fa fa-chevron-left"> Terug naar de groep</button></a>
</li>
</ul>
</div>
</div>
</div>