Browse Source

- Fix lot of little issues for the mobile version + disabling animations

- Add desktop notifications
pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
04aa690b38
  1. 6
      app/assets/js/movim_base.js
  2. 9
      app/assets/js/movim_utils.js
  3. 13
      app/widgets/Chat/Chat.php
  4. 7
      app/widgets/Chat/chat.js
  5. 4
      app/widgets/Login/login.css
  6. 19
      themes/movim/css/animations.css
  7. 5
      themes/movim/css/forms.css
  8. 44
      themes/movim/css/mobile.css
  9. 2
      themes/movim/css/style.css

6
app/assets/js/movim_base.js

@ -44,6 +44,12 @@ function movim_title_inc() {
messages_cpt++;
}
function movim_desktop_notification(title, body, image) {
var notification = new Notification(title, { icon: image, body: body });
notification.onshow = function() { setTimeout(notification.cancel(), 15000); }
}
/**
* TODO : remove this function
*/

9
app/assets/js/movim_utils.js

@ -188,3 +188,12 @@ function movim_toggle_display(element) {
else
node.style.display = 'block';
}
window.addEventListener('load', function () {
Notification.requestPermission(function (status) {
// This allows to use Notification.permission with Chrome/Safari
if (Notification.permission !== status) {
Notification.permission = status;
}
});
});

13
app/widgets/Chat/Chat.php

@ -79,20 +79,21 @@ class Chat extends WidgetBase
$jid = $message->jidfrom;
}
if($message->session != $message->jidfrom)
RPC::call('notify');
$rd = new \modl\RosterLinkDAO();
$rc = new \modl\ContactDAO();
$contact = $rc->getRosterItem(echapJid($jid));
if($message->session != $message->jidfrom)
RPC::call(
'notify',
$contact->getTrueName(),
$message->body,
$contact->getPhoto('m'));
if($contact != null && $contact->chaton == 0) {
$contact->chaton = 2;
$rd->setChat($jid, 2);
//$evt = new Event();
//$evt->runEvent('openchat');
RPC::call('movim_prepend',
'chats',

7
app/widgets/Chat/chat.js

@ -64,13 +64,10 @@ function showPaused(jid) {
paused.style.display = 'block';
}
function notify() {
function notify(params) {
if(document_focus == false) {
movim_title_inc();
//play the notif sound
/*chatSoundNotif.pause();
chatSoundNotif.currentTime= 0;
chatSoundNotif.play();*/
movim_desktop_notification(params[0], params[1], params[2]);
}
}

4
app/widgets/Login/login.css

@ -124,4 +124,8 @@ footer {
#loginpage {
background-size: 80% auto;
}
#loginhelp {
display: none;
}
}

19
themes/movim/css/animations.css

@ -55,3 +55,22 @@
80% { background-color: #294265; }
100% { background-color: #3C7E91; }
}
@media screen and (max-width: 1024px) {
.fadeDown {
-webkit-animation: none;
-moz-animation: none;
-ms-animation: none;
-o-animation: none;
animation: none;
}
@keyframes colorful {
0% { background-color: #3C7E91; }
}
@-webkit-keyframes colorful {
0% { background-color: #3C7E91; }
}
}

5
themes/movim/css/forms.css

@ -22,6 +22,11 @@ legend {
width: 51%;
border-bottom: 1px solid rgb(220, 220, 220) !important;
line-height: 3em !important;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: text-bottom;
}

44
themes/movim/css/mobile.css

@ -7,7 +7,7 @@ body {
width: 100%;
position: relative;
left: 0;
transition: left 0.5s ease;
/*transition: left 0.5s ease;*/
overflow-x: hidden;
}
@ -23,6 +23,10 @@ body.infos {
display: inherit;
}
h1 {
padding: 0em 0.4em;
}
#right {
width: 100%;
padding: 0px;
@ -101,7 +105,7 @@ nav .menu li a.disconnect {
}
table#feedsubmitform {
margin: 0 1em;
margin: 0 0.5em;
}
.element {
@ -113,15 +117,15 @@ table#feedsubmitform {
}
.posthead {
padding: 1em;
padding: 0.5em;
}
.post {
padding: 1em 1em;
padding: 0.5em;
}
.post .avatar {
margin-right: 1em;
margin-right: 0.5em;
}
.post .postbubble {
@ -236,6 +240,36 @@ ul.thumb li {
margin-top: 3em !important;
}
/* A default padding for some elements */
.padded {
padding: 0.5em;
}
.paddedtop {
padding: 0.5em;
padding-top: 0px;
}
.paddedtopbottom {
padding: 0em 0.5em;
}
.spacetop {
padding-top: 0.5em;
}
/* Definition list */
dl dt {
text-align: left;
width: 100%;
}
dl dd {
text-align: left;
width: 100%;
}
}
@media screen and (max-width: 640px) {

2
themes/movim/css/style.css

@ -44,7 +44,7 @@ time, mark, audio, video {
body {
font-family: helvetica,sans-serif, Helvetica, "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 14px;
font-size: 15px;
line-height: 1em;
color: #4E4E4E;

Loading…
Cancel
Save