Browse Source

- Add some new icons

- Mode all the actual icons to the theme/ folder
- Clean the widgets icons
pull/5/head
Jaussoin Timothée 14 years ago
parent
commit
74e9996ceb
  1. 178
      system/Widget/widgets/Chatold/Chat.php
  2. 83
      system/Widget/widgets/Chatold/chat.css
  3. 31
      system/Widget/widgets/Chatold/chat.js
  4. BIN
      system/Widget/widgets/Chatold/img/cross.png
  5. 8
      system/Widget/widgets/ContactCard/ContactCard.php
  6. 16
      system/Widget/widgets/ContactCard/contactcard.css
  7. BIN
      system/Widget/widgets/ContactCard/img/rect2987-8-1-4.png
  8. 3
      system/Widget/widgets/ContactSummary/contactsummary.css
  9. 2
      system/Widget/widgets/Feed/Feed.php
  10. 3
      system/Widget/widgets/Feed/feed.css
  11. 4
      system/Widget/widgets/Notifs/Notifs.php
  12. 5
      system/Widget/widgets/Notifs/notifs.css
  13. BIN
      system/Widget/widgets/Roster/img/server_error.png
  14. 4
      system/Widget/widgets/Wall/Wall.php
  15. 4
      system/Widget/widgets/Wall/wall.css
  16. 15
      themes/movim/css/style2.css
  17. 0
      themes/movim/img/icons/add_icon.png
  18. 0
      themes/movim/img/icons/chat_icon.png
  19. 0
      themes/movim/img/icons/comments_icon.png
  20. 0
      themes/movim/img/icons/follow_icon.png
  21. 0
      themes/movim/img/icons/no_icon.png
  22. 0
      themes/movim/img/icons/rm_icon.png
  23. BIN
      themes/movim/img/icons/submit_icon.png
  24. 0
      themes/movim/img/icons/yes_icon.png

178
system/Widget/widgets/Chatold/Chat.php

@ -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
}
}

83
system/Widget/widgets/Chatold/chat.css

@ -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;
}

31
system/Widget/widgets/Chatold/chat.js

@ -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;
}

BIN
system/Widget/widgets/Chatold/img/cross.png

Before

Width: 11  |  Height: 11  |  Size: 303 B

8
system/Widget/widgets/ContactCard/ContactCard.php

@ -45,7 +45,7 @@ class ContactCard extends WidgetBase
$html .='
<a
class="button tiny icon"
class="button tiny icon rm"
href="#"
style="float: right;"
id="friendremoveask"
@ -59,7 +59,7 @@ class ContactCard extends WidgetBase
</a>
<a
class="button tiny icon"
class="button tiny icon no"
href="#"
style="float: right; display: none;"
id="friendremoveno"
@ -73,7 +73,7 @@ class ContactCard extends WidgetBase
</a>
<a
class="button tiny icon"
class="button tiny icon yes"
href="#"
id="friendremoveyes"
style="float: right; display: none;"
@ -85,7 +85,7 @@ class ContactCard extends WidgetBase
if(isset($presence['presence']) && $presence['presence'] != 5) {
$html .= '
<a
class="button tiny icon"
class="button tiny icon chat"
href="#"
style="float: right;"
id="friendchat"

16
system/Widget/widgets/ContactCard/contactcard.css

@ -25,19 +25,3 @@
float: left;
width: auto;
}
#contactcard #friendremoveask {
background-image: url(img/rm_icon.png);
}
#contactcard #friendremoveyes {
background-image: url(img/yes_icon.png);
}
#contactcard #friendremoveno {
background-image: url(img/no_icon.png);
}
#contactcard #friendchat {
background-image: url(img/chat_icon.png);
}

BIN
system/Widget/widgets/ContactCard/img/rect2987-8-1-4.png

Before

Width: 10  |  Height: 10  |  Size: 311 B

3
system/Widget/widgets/ContactSummary/contactsummary.css

@ -7,6 +7,9 @@
padding: 0px;
border: none;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#contactsummary img {

2
system/Widget/widgets/Feed/Feed.php

@ -100,7 +100,7 @@ class Feed extends WidgetBase {
<textarea id="feedmessage" onfocus="this.value=''; this.style.color='#333333'; this.onfocus=null;"><?php echo t('What\'s new ?'); ?></textarea>
<a
onclick="<?php $this->callAjax('ajaxPublishItem', "document.querySelector('#feedmessage').value") ?>"
href="#" id="feedmessagesubmit" class="button tiny"><?php echo t("Submit"); ?></a><br />
href="#" id="feedmessagesubmit" class="button tiny icon submit"><?php echo t("Submit"); ?></a><br />
<!--<a href="#" onclick="<?php $this->callAjax('ajaxPublishItem', "'BAZINGA !'") ?>">go !</a>-->
<!--<a href="#" onclick="<?php $this->callAjax('ajaxCreateNode') ?>">create !</a>-->
<!--<a href="#" onclick="<?php $this->callAjax('ajaxGetElements') ?>">get !</a>-->

3
system/Widget/widgets/Feed/feed.css

@ -6,14 +6,13 @@
#feed #feedmessage {
resize: none;
width: 80%;
width: 85%;
border: 1px solid #E5E5E5;
margin: 0.5em 0em;
padding: 5px;
}
#feed #feedmessagesubmit {
width: 15%;
margin: 1.7em 0em;
float: right;
}

4
system/Widget/widgets/Notifs/Notifs.php

@ -102,8 +102,8 @@ class Notifs extends WidgetBase
<li>
<input id="addjid" class="tiny" value="user@server.tld" onfocus="myFocus(this);" onblur="myBlur(this);"/>
<input id="addalias" class="tiny" value="<?php echo t('Alias'); ?>" onfocus="myFocus(this);" onblur="myBlur(this);"/>
<a class="button tiny" href="#" id="addvalidate" onclick="<?php $this->callAjax("ajaxAddContact", "getAddJid()", "getAddAlias()"); ?>"><?php echo t('Validate'); ?></a>
<a class="button tiny icon" id="addask" href="#" onclick="addJid(this);"><?php echo t('Add a contact'); ?></a>
<a class="button tiny icon yes" href="#" id="addvalidate" onclick="<?php $this->callAjax("ajaxAddContact", "getAddJid()", "getAddAlias()"); ?>"><?php echo t('Validate'); ?></a>
<a class="button tiny icon add" href="#" onclick="addJid(this);"><?php echo t('Add a contact'); ?></a>
</li>
</ul>
</div>

5
system/Widget/widgets/Notifs/notifs.css

@ -1,5 +1,4 @@
#notifs {
/* width: 95%;*/
padding-right: 5px;
clear: both;
}
@ -39,7 +38,3 @@
#notifs #notifsvalidate, #notifs #addvalidate {
display: none;
}
#notifs #addask {
background-image: url(img/add_icon.png);
}

BIN
system/Widget/widgets/Roster/img/server_error.png

After

Width: 17  |  Height: 17  |  Size: 423 B

4
system/Widget/widgets/Wall/Wall.php

@ -77,7 +77,7 @@ class Wall extends WidgetBase
'.prepareString($message->getData('content')).'
</div>
<div class="comments" id="'.$message->getData('nodeid').'comments">
<a class="getcomments" onclick="'.$this->genCallAjax('ajaxGetComments', "'".$message->getData('jid')."'", "'".$message->getData('nodeid')."'").'; this.innerHTML = \''.t('Loading comments ...').'\'">'.t('Get the comments').'</a>
<a class="getcomments icon comments" style="margin-left: 0px;" onclick="'.$this->genCallAjax('ajaxGetComments', "'".$message->getData('jid')."'", "'".$message->getData('nodeid')."'").'; this.innerHTML = \''.t('Loading comments ...').'\'">'.t('Get the comments').'</a>
</div>
</div>';
}
@ -231,6 +231,8 @@ class Wall extends WidgetBase
}
?>
<br />
<div class="config_button" onclick="<?php $this->callAjax('ajaxWall', "'".$_GET['f']."'");?>"></div>
</div>
<?php
}

4
system/Widget/widgets/Wall/wall.css

@ -5,7 +5,7 @@
}
#wall .getcomments {
background-image: url(img/comments_icon.png);
/* background-image: url(img/comments_icon.png);*/
background-repeat: no-repeat;
background-position: 5px 5px;
padding: 2px;
@ -17,3 +17,5 @@
#wall #wallfollow {
background-image: url(img/follow_icon.png);
}

15
themes/movim/css/style2.css

@ -158,16 +158,12 @@ input[type=submit], input[type=reset], input[type=button], .button, .button:link
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 3px;
margin-left: 5px;
/* text-shadow: 0 1px #F0F0F0;*/
color: #666;
background-color: #F5F5F5;
font-weight: bold;
font-family: Arial,sans-serif;
text-align: center;
/* background: -webkit-gradient(linear, 0% 39%, 0% 100%, from(#F6F6F6), to(#d0d0d0));
background: -moz-linear-gradient(top, #F6F6F6, #d0d0d0);*/
}
.button.tiny.icon {
@ -176,9 +172,16 @@ input[type=submit], input[type=reset], input[type=button], .button, .button:link
background-position: 6px 6px;
}
.icon.yes { background-image: url(../img/icons/yes_icon.png); }
.icon.no { background-image: url(../img/icons/no_icon.png); }
.icon.comments { background-image: url(../img/icons/comments_icon.png); }
.icon.follow { background-image: url(../img/icons/follow_icon.png); }
.icon.chat{ background-image: url(../img/icons/chat_icon.png); }
.icon.add { background-image: url(../img/icons/add_icon.png); }
.icon.rm { background-image: url(../img/icons/rm_icon.png); }
.icon.submit { background-image: url(../img/icons/submit_icon.png); }
input:hover[type=submit], input[type=reset]:hover, input[type=button]:hover, .button:hover {
/* background: -webkit-gradient(linear, 0% 39%, 0% 100%, from(#F6F6F6), to(#c0c0c0));*/
/* background: -moz-linear-gradient(top, #F6F6F6, #c0c0c0);*/
background-color: #F8F8F8;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
border-color: #C6C6C6;

0
system/Widget/widgets/Notifs/img/add_icon.png → themes/movim/img/icons/add_icon.png

Before

Width: 10  |  Height: 10  |  Size: 233 B

After

Width: 10  |  Height: 10  |  Size: 233 B

0
system/Widget/widgets/ContactCard/img/chat_icon.png → themes/movim/img/icons/chat_icon.png

Before

Width: 10  |  Height: 10  |  Size: 296 B

After

Width: 10  |  Height: 10  |  Size: 296 B

0
system/Widget/widgets/Wall/img/comments_icon.png → themes/movim/img/icons/comments_icon.png

Before

Width: 10  |  Height: 10  |  Size: 214 B

After

Width: 10  |  Height: 10  |  Size: 214 B

0
system/Widget/widgets/Wall/img/follow_icon.png → themes/movim/img/icons/follow_icon.png

Before

Width: 11  |  Height: 10  |  Size: 458 B

After

Width: 11  |  Height: 10  |  Size: 458 B

0
system/Widget/widgets/ContactCard/img/no_icon.png → themes/movim/img/icons/no_icon.png

Before

Width: 10  |  Height: 10  |  Size: 388 B

After

Width: 10  |  Height: 10  |  Size: 388 B

0
system/Widget/widgets/ContactCard/img/rm_icon.png → themes/movim/img/icons/rm_icon.png

Before

Width: 10  |  Height: 10  |  Size: 192 B

After

Width: 10  |  Height: 10  |  Size: 192 B

BIN
themes/movim/img/icons/submit_icon.png

After

Width: 10  |  Height: 10  |  Size: 322 B

0
system/Widget/widgets/ContactCard/img/yes_icon.png → themes/movim/img/icons/yes_icon.png

Before

Width: 10  |  Height: 10  |  Size: 372 B

After

Width: 10  |  Height: 10  |  Size: 372 B

Loading…
Cancel
Save