Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-Chat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SST
PHP-Chat
Commits
4e210cf2
Commit
4e210cf2
authored
Jul 18, 2016
by
Markus Bergt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lots of stuff
parent
fc21859f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
4 deletions
+77
-4
customJS.js
customJS.js
+50
-0
newChat.php
newChat.php
+27
-4
No files found.
customJS.js
View file @
4e210cf2
...
...
@@ -30,6 +30,56 @@ $(document).ready(function() {
);
}
$
(
'#sendMessage'
).
click
(
function
(){
if
(
this
.
hasClass
(
'btn-default'
)
{
//send default
}
if
()
});
$
(
'#changeToNormal'
).
click
(
function
(){
var
obj
=
$
(
'#sendMessage'
);
if
(
obj
.
hasClass
(
'btn-danger'
))
{
obj
.
removeClass
(
'btn-danger'
);
}
if
(
obj
.
hasClass
(
'btn-warning'
))
{
obj
.
removeClass
(
'btn-warning'
);
}
obj
.
addClass
(
'btn-default'
);
obj
.
attr
(
'name'
,
'chatok'
);
});
$
(
'#changeToMod'
).
click
(
function
(){
var
obj
=
$
(
'#sendMessage'
);
if
(
obj
.
hasClass
(
'btn-default'
))
{
obj
.
removeClass
(
'btn-default'
);
}
if
(
obj
.
hasClass
(
'btn-danger'
))
{
obj
.
removeClass
(
'btn-danger'
);
}
obj
.
addClass
(
'btn-warning'
);
$
(
'#sendMessage'
).
attr
(
'name'
,
'modok'
);
});
$
(
'#changeToAdmin'
).
click
(
function
(){
var
obj
=
$
(
'#sendMessage'
);
if
(
obj
.
hasClass
(
'btn-default'
))
{
obj
.
removeClass
(
'btn-default'
);
}
if
(
obj
.
hasClass
(
'btn-warning'
))
{
obj
.
removeClass
(
'btn-warning'
);
}
obj
.
addClass
(
'btn-danger'
);
$
(
'#sendMessage'
).
attr
(
'name'
,
'adminok'
);
});
$
(
'#showRegBtn'
).
click
(
function
(){
$
(
'#loginCol'
).
hide
();
$
(
'#registerCol'
).
show
();
...
...
newChat.php
View file @
4e210cf2
...
...
@@ -94,17 +94,40 @@ else{
<nav
class=
"navbar navbar-default navbar-fixed-bottom chatnavbar"
>
<div
class=
"container-fluid"
>
<
div
class=
"
"
id=
"chatbar"
>
<
form
class=
"form-inline"
role=
"form
"
id=
"chatbar"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon hidden-xs"
>
Username
:
</span>
<span
class=
"input-group-addon hidden-xs"
>
<?php
echo
$users
[
'name'
];
?>
:
</span>
<input
type=
"text"
class=
"form-control"
placeholder=
"Deine Nachricht..."
autofocus
>
<span
class=
"input-group-btn"
>
<button
class=
"btn btn-default"
type=
"button"
><span
class=
"glyphicon glyphicon-send"
/>
<span
class=
"hidden-xs"
>
Senden
</span></button>
<button
class=
"btn btn-default"
id=
"sendMessage"
name=
"chatok"
type=
"submit"
><span
class=
"glyphicon glyphicon-send"
/>
<span
class=
"hidden-xs"
>
Senden
</span></button>
<?php
if
(
$users
[
'admin'
]
>=
1
)
{
?>
<button
type=
"button"
class=
"btn btn-default dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<span
class=
"caret"
/>
<span
class=
"sr-only"
>
Toggle Dropdown
</span>
</button>
<ul
class=
"dropdown-menu dropdown-menu-right"
>
<li><a
href=
"#"
id=
"changeToNormal"
>
Normal
</a></li>
<li><a
href=
"#"
id=
"changeToMod"
>
Mod
</a></li>
<?php
if
(
$users
[
'admin'
]
>=
2
)
{
?>
<li><a
href=
"#"
id=
"changeToAdmin"
>
Admin
</a></li>
<?php
}
?>
</ul>
<?php
}
?>
<button
class=
"btn btn-default"
type=
"button"
><span
class=
"glyphicon glyphicon-send glyphicon-warning"
/>
<span
class=
"hidden-xs"
>
Mod
</span></button>
<button
class=
"btn btn-default"
type=
"button"
><span
class=
"glyphicon glyphicon-send glyphicon-danger"
/>
<span
class=
"hidden-xs"
>
Admin
</span></button>
</span>
</div>
</
div
>
</
form
>
</div>
</nav>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment