Browse Source
- Add Notification widget
- Add Notification widget
- Add Notification event on some widgets - Add Attention support in Chatpull/16/head
20 changed files with 174 additions and 30 deletions
-
1system/Widget/widgets/Bookmark/Bookmark.php
-
24system/Widget/widgets/Chat/Chat.php
-
1system/Widget/widgets/Config/Config.php
-
1system/Widget/widgets/ContactManage/ContactManage.php
-
12system/Widget/widgets/Feed/Feed.php
-
4system/Widget/widgets/GroupConfig/GroupConfig.php
-
51system/Widget/widgets/Notification/Notification.php
-
BINsystem/Widget/widgets/Notification/img/error.png
-
BINsystem/Widget/widgets/Notification/img/info.png
-
BINsystem/Widget/widgets/Notification/img/success.png
-
BINsystem/Widget/widgets/Notification/img/warning.png
-
69system/Widget/widgets/Notification/notification.css
-
4system/Widget/widgets/Notification/notification.js
-
3system/Widget/widgets/Profile/Profile.php
-
15system/Widget/widgets/ProfileData/ProfileData.php
-
1system/Widget/widgets/Roster/Roster.php
-
14system/Widget/widgets/ServerNodes/ServerNodes.php
-
1system/Widget/widgets/Vcard/Vcard.php
-
2themes/movim/css/forms.css
-
1themes/movim/page.tpl
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
/** |
|||
* @package Widgets |
|||
* |
|||
* @file Notifs.php |
|||
* This file is part of MOVIM. |
|||
* |
|||
* @brief The notification widget |
|||
* |
|||
* @author Timothée Jaussoin <edhelas@gmail.com> |
|||
* |
|||
* @version 1.0 |
|||
* @date 16 juin 2011 |
|||
* |
|||
* Copyright (C)2010 MOVIM project |
|||
* |
|||
* See COPYING for licensing information. |
|||
*/ |
|||
|
|||
class Notification extends WidgetCommon |
|||
{ |
|||
function WidgetLoad() |
|||
{ |
|||
$this->addcss('notification.css'); |
|||
$this->addjs('notification.js'); |
|||
} |
|||
|
|||
static function appendNotification($message, $type = 'info') |
|||
{ |
|||
$id = sha1($message.rand(0, 1500)); |
|||
$html = ' |
|||
<div |
|||
class="notif notificationAnim '.$type.'" |
|||
id="'.$id.'" |
|||
>'.$message.'</div>'; |
|||
|
|||
RPC::call('movim_append', 'notification', $html); |
|||
RPC::call('removeDiff', $id); |
|||
RPC::commit(); |
|||
} |
|||
|
|||
function build() |
|||
{ |
|||
?>
|
|||
<div id="notification"> |
|||
|
|||
</div> |
|||
<?php |
|||
} |
|||
} |
|||
|
After Width: 16 | Height: 16 | Size: 246 B |
|
After Width: 16 | Height: 16 | Size: 237 B |
|
After Width: 16 | Height: 16 | Size: 319 B |
|
After Width: 16 | Height: 16 | Size: 138 B |
@ -0,0 +1,69 @@ |
|||
#notification { |
|||
position: fixed; |
|||
bottom: 0px; |
|||
left: 0px; |
|||
z-index: 5; |
|||
} |
|||
|
|||
#notification .notif { |
|||
background-color: rgba(0, 0, 0, 0.8); |
|||
width: 250px; |
|||
margin: 5px; |
|||
border-radius: 2px; |
|||
box-shadow: 0px 0px 5px black; |
|||
color: white; |
|||
padding: 1em; |
|||
padding-left: 3em; |
|||
opacity: 1; |
|||
|
|||
background-repeat: no-repeat; |
|||
background-position: 1em 1em; |
|||
background-image: url(img/success.png); |
|||
} |
|||
|
|||
#notification .notif.error { |
|||
background-image: url(img/error.png); |
|||
} |
|||
|
|||
#notification .notif.warning { |
|||
background-image: url(img/warning.png); |
|||
} |
|||
|
|||
#notification .notif.info { |
|||
background-image: url(img/info.png); |
|||
} |
|||
|
|||
#notification .notif:hover { |
|||
opacity: 0.4; |
|||
} |
|||
|
|||
|
|||
.notificationAnim { |
|||
opacity: 0; |
|||
visibility: hidden; |
|||
position: relative; |
|||
-webkit-animation: fadeOut 5s linear; |
|||
-moz-animation: fadeOut 5s linear; |
|||
-ms-animation: fadeOut 5s linear; |
|||
-o-animation: fadeOut 5s linear; |
|||
animation: fadeOut 5s linear; |
|||
} |
|||
|
|||
@-webkit-keyframes fadeOut { |
|||
0% { opacity: 1; visibility: visible; left: 0px; } |
|||
90% { opacity: 1; visibility: visible; left: 0px; } |
|||
100% { opacity: 0; visibility: hidden; left: -300px; } |
|||
} |
|||
|
|||
@-moz-keyframes fadeOut { |
|||
0% { opacity: 0; visibility: visible; left: 0px; } |
|||
5% { opacity: 1; visibility: visible; left: 0px; } |
|||
90% { opacity: 1; visibility: visible; left: 0px; } |
|||
100% { opacity: 0; visibility: hidden; left: -300px; } |
|||
} |
|||
|
|||
@-ms-keyframes fadeOut { |
|||
0% { opacity: 1; visibility: visible; left: 0px; } |
|||
90% { opacity: 1; visibility: visible; left: 0px; } |
|||
100% { opacity: 0; visibility: hidden; left: -300px; } |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
function removeDiff(params) { |
|||
target = document.getElementById(params[0]); |
|||
setTimeout(function() {target.parentNode.removeChild(target);}, 5000); |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue