- Add some new icons
- Mode all the actual icons to the theme/ folder - Clean the widgets iconspull/5/head
-
178system/Widget/widgets/Chatold/Chat.php
-
83system/Widget/widgets/Chatold/chat.css
-
31system/Widget/widgets/Chatold/chat.js
-
BINsystem/Widget/widgets/Chatold/img/cross.png
-
8system/Widget/widgets/ContactCard/ContactCard.php
-
16system/Widget/widgets/ContactCard/contactcard.css
-
BINsystem/Widget/widgets/ContactCard/img/rect2987-8-1-4.png
-
3system/Widget/widgets/ContactSummary/contactsummary.css
-
2system/Widget/widgets/Feed/Feed.php
-
3system/Widget/widgets/Feed/feed.css
-
4system/Widget/widgets/Notifs/Notifs.php
-
5system/Widget/widgets/Notifs/notifs.css
-
BINsystem/Widget/widgets/Roster/img/server_error.png
-
4system/Widget/widgets/Wall/Wall.php
-
4system/Widget/widgets/Wall/wall.css
-
15themes/movim/css/style2.css
-
0themes/movim/img/icons/add_icon.png
-
0themes/movim/img/icons/chat_icon.png
-
0themes/movim/img/icons/comments_icon.png
-
0themes/movim/img/icons/follow_icon.png
-
0themes/movim/img/icons/no_icon.png
-
0themes/movim/img/icons/rm_icon.png
-
BINthemes/movim/img/icons/submit_icon.png
-
0themes/movim/img/icons/yes_icon.png
@ -1,178 +0,0 @@ |
|||
<?php |
|||
|
|||
/** |
|||
* @package Widgets |
|||
* |
|||
* @file Chat.php |
|||
* This file is part of MOVIM. |
|||
* |
|||
* @brief A jabber chat widget. |
|||
* |
|||
* @author Guillaume Pasquet <etenil@etenilsrealm.nl> |
|||
* |
|||
* @version 1.0 |
|||
* @date 20 October 2010 |
|||
* |
|||
* Copyright (C)2010 MOVIM project |
|||
* |
|||
* See COPYING for licensing information. |
|||
*/ |
|||
|
|||
class Chat extends WidgetBase |
|||
{ |
|||
function WidgetLoad() |
|||
{ |
|||
$this->addcss('chat.css'); |
|||
$this->addjs('chat.js'); |
|||
|
|||
$this->registerEvent('incomemessage', 'onMessage'); |
|||
$this->registerEvent('incomecomposing', 'onComposing'); |
|||
$this->registerEvent('incomepaused', 'onPaused'); |
|||
|
|||
if(Cache::c('activechat') == false) |
|||
Cache::c('activechat', array()); |
|||
} |
|||
|
|||
/** |
|||
* Open a new talk |
|||
* |
|||
* @param string $jid |
|||
* @return void |
|||
*/ |
|||
function ajaxOpenTalk($jid) |
|||
{ |
|||
$talks = Cache::c('activechat'); |
|||
if(!array_key_exists($jid, $talks)) { |
|||
RPC::call('movim_prepend', |
|||
'talks', |
|||
RPC::cdata($this->prepareTalk($jid, true))); |
|||
$talks[$jid] = true; |
|||
Cache::c('activechat', $talks); |
|||
RPC::commit(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Close a talk |
|||
* |
|||
* @param string $jid |
|||
* @return void |
|||
*/ |
|||
function ajaxCloseTalk($jid) |
|||
{ |
|||
$talks = Cache::c('activechat'); |
|||
unset($talks[$jid]); |
|||
Cache::c('activechat', $talks); |
|||
} |
|||
|
|||
/** |
|||
* Send a message |
|||
* |
|||
* @param string $to |
|||
* @param string $message |
|||
* @return void |
|||
*/ |
|||
function ajaxSendMessage($to, $message) |
|||
{ |
|||
$xmpp = Jabber::getInstance(); |
|||
$xmpp->sendMessage($to, $message); |
|||
} |
|||
|
|||
/** |
|||
* When we receive a message |
|||
* |
|||
* @param array $data |
|||
* @return void |
|||
*/ |
|||
function onMessage($data) |
|||
{ |
|||
$talks = Cache::c('activechat'); |
|||
list($jid) = explode('/', $data['from']); |
|||
|
|||
if(!array_key_exists($jid, $talks)) { |
|||
RPC::call('movim_prepend', |
|||
'talks', |
|||
RPC::cdata($this->prepareTalk($jid, true))); |
|||
$talks[$jid] = true; |
|||
Cache::c('activechat', $talks); |
|||
} |
|||
|
|||
RPC::call('movim_fill', |
|||
$jid.'Tab', |
|||
RPC::cdata($jid)); |
|||
|
|||
RPC::call('movim_prepend', |
|||
$jid.'Messages', |
|||
RPC::cdata('<p class="message"><span class="date">'.date('G:i', time()).'</span>'.htmlentities($data['body'], ENT_COMPAT, "UTF-8").'</p>')); |
|||
} |
|||
|
|||
/** |
|||
* On composing |
|||
* |
|||
* @param array $data |
|||
* @return void |
|||
*/ |
|||
function onComposing($data) |
|||
{ |
|||
list($jid) = explode('/', $data['from']); |
|||
RPC::call('movim_fill', |
|||
$jid.'Tab', |
|||
t('Composing')); |
|||
} |
|||
|
|||
/** |
|||
* On paused |
|||
* |
|||
* @param array $data |
|||
* @return void |
|||
*/ |
|||
function onPaused($data) |
|||
{ |
|||
list($jid) = explode('/', $data['from']); |
|||
RPC::call('movim_fill', |
|||
$jid.'Tab', |
|||
t('Paused')); |
|||
} |
|||
|
|||
/** |
|||
* prepareTalk |
|||
* |
|||
* @param string $jid |
|||
* @param bool $new = false |
|||
* @return void |
|||
*/ |
|||
public function prepareTalk($jid, $new = false) |
|||
{ |
|||
$style = ($new) ? ' style="display: block" ' : ''; |
|||
|
|||
return ' |
|||
<div class="talk"> |
|||
<div class="box" id="'.$jid.'Box" '.$style.'> |
|||
<div class="messages" id="'.$jid.'Messages"></div> |
|||
<input |
|||
type="text" |
|||
class="input" |
|||
value="'.t('Message').'" |
|||
onfocus="myFocus(this);" |
|||
onblur="myBlur(this);" |
|||
onkeypress="if(event.keyCode == 13) {'.$this->genCallAjax('ajaxSendMessage', "'".$jid."'", "sendMessage(this, '".$jid."')").'}"/> |
|||
</div> |
|||
|
|||
<span class="tab" id="'.$jid.'Tab" onclick="showTalk(this);">'.$jid.'</span> |
|||
<span class="cross" onclick="'.$this->genCallAjax("ajaxCloseTalk", "'".$jid."'").' closeTalk(this)"></span> |
|||
</div> |
|||
'; |
|||
} |
|||
|
|||
function build() |
|||
{ |
|||
$talks = Cache::c('activechat'); |
|||
?>
|
|||
<div id="talks"> |
|||
<?php foreach($talks as $key => $value){ |
|||
echo $this->prepareTalk($key); |
|||
} ?>
|
|||
</div> |
|||
<?php |
|||
} |
|||
} |
|||
@ -1,83 +0,0 @@ |
|||
#talks { |
|||
position: fixed; |
|||
bottom: 0; |
|||
right: 0; |
|||
} |
|||
|
|||
.talk { |
|||
float: right; |
|||
position: relative; |
|||
width: 200px; |
|||
height: 250px; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.talk span.cross { |
|||
width: 16px; |
|||
height: 16px; |
|||
float: right; |
|||
padding: 1px; |
|||
background-image: url(img/cross.png); |
|||
background-repeat: no-repeat; |
|||
background-position: 0px 3px; |
|||
position:absolute; |
|||
bottom:0; |
|||
right: 0; |
|||
} |
|||
|
|||
.talk span.cross:hover, |
|||
.talk span.tab:hover { |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.talk span.tab { |
|||
position:absolute; |
|||
bottom:0; |
|||
width: 100%; |
|||
padding: 2px; |
|||
background-color: #EFEFEF; |
|||
border-top: 1px solid #DCDCDC; |
|||
border-left: 1px solid #DCDCDC; |
|||
} |
|||
|
|||
.talk .box { |
|||
background-color: white; |
|||
height: 230px; |
|||
overflow: auto; |
|||
|
|||
display: none; |
|||
border: 1px solid #DCDCDC; |
|||
} |
|||
|
|||
.talk .box .message { |
|||
border-bottom: 1px solid #EEE; |
|||
padding: 3px; |
|||
max-width: 100%; |
|||
min-height: 15px; |
|||
} |
|||
|
|||
.talk .box .info { |
|||
background-color: #D0CAC7; |
|||
} |
|||
|
|||
.talk .box .message .date { |
|||
color: #BDBDBD; |
|||
float: right; |
|||
padding-right: 5px; |
|||
} |
|||
|
|||
.talk .box .me { |
|||
border-left: 2px solid #AEAEAE; |
|||
} |
|||
|
|||
.talk .box .input { |
|||
position:absolute; |
|||
bottom:20px; |
|||
margin: 0px; |
|||
width: 192px; |
|||
padding: 3px; |
|||
border-radius: 0px; |
|||
border-left: 0px; |
|||
border-right: 0px; |
|||
border-top: 1px solid #DCDCDC; |
|||
} |
|||
@ -1,31 +0,0 @@ |
|||
function closeTalk(n) { |
|||
n.parentNode.parentNode.removeChild(n.parentNode); |
|||
} |
|||
|
|||
function showTalk(n) { |
|||
var box = n.parentNode.querySelector('.box'); |
|||
if(box.style.display == "block") { |
|||
box.style.display = "none"; |
|||
} else { |
|||
box.style.display = "block"; |
|||
} |
|||
} |
|||
|
|||
function sendMessage(n, jid) |
|||
{ |
|||
var text = n.value; |
|||
var date = new Date(); |
|||
|
|||
var h = date.getHours(); |
|||
if (h<10) {h = "0" + h} |
|||
|
|||
var m = date.getMinutes(); |
|||
if (m<10) {m = "0" + m} |
|||
|
|||
var box = document.getElementById(jid + 'Messages'); |
|||
box.innerHTML = '<p class="message me"><span class="date">' + h + ':' + m + '</span>' + text + '</p>' + n.parentNode.innerHTML; |
|||
n.value = ""; |
|||
n.focus(); |
|||
return text; |
|||
|
|||
} |
|||
|
Before Width: 11 | Height: 11 | Size: 303 B |
|
Before Width: 10 | Height: 10 | Size: 311 B |
|
After Width: 17 | Height: 17 | Size: 423 B |
|
Before Width: 10 | Height: 10 | Size: 233 B After Width: 10 | Height: 10 | Size: 233 B |
|
Before Width: 10 | Height: 10 | Size: 296 B After Width: 10 | Height: 10 | Size: 296 B |
|
Before Width: 10 | Height: 10 | Size: 214 B After Width: 10 | Height: 10 | Size: 214 B |
|
Before Width: 11 | Height: 10 | Size: 458 B After Width: 11 | Height: 10 | Size: 458 B |
|
Before Width: 10 | Height: 10 | Size: 388 B After Width: 10 | Height: 10 | Size: 388 B |
|
Before Width: 10 | Height: 10 | Size: 192 B After Width: 10 | Height: 10 | Size: 192 B |
|
After Width: 10 | Height: 10 | Size: 322 B |
|
Before Width: 10 | Height: 10 | Size: 372 B After Width: 10 | Height: 10 | Size: 372 B |