Browse Source

merge with movim

pull/16/head
Christine Ho 11 years ago
parent
commit
60f1f1197a
  1. 62
      app/helpers/StringHelper.php
  2. 4
      app/models/contact/ContactDAO.php
  3. 4
      app/views/main.tpl
  4. 30
      app/widgets/Chat/Chat.php
  5. 6
      app/widgets/Chat/_chat.tpl
  6. 19
      app/widgets/Chat/_chat_message.tpl
  7. 85
      app/widgets/Chat/_chat_smiley.tpl
  8. 18
      app/widgets/Chat/chat.css
  9. 14
      app/widgets/Chat/chat.js
  10. 12
      app/widgets/Chats/Chats.php
  11. 4
      app/widgets/Chats/_chats_item.tpl
  12. 4
      app/widgets/Chats/chats.js
  13. 1
      app/widgets/Init/init.js
  14. 4
      app/widgets/Notification/notification.js
  15. 2
      app/widgets/Post/_post_preview.tpl
  16. 1
      app/widgets/Presence/Presence.php
  17. 2
      app/widgets/Presence/_presence.tpl
  18. 2
      app/widgets/Roster/roster.js
  19. 6
      linker.php
  20. 10
      system/widget/WidgetWrapper.php
  21. 4
      themes/material/css/list.css
  22. BIN
      themes/material/img/emojis/large/1f004.png
  23. BIN
      themes/material/img/emojis/large/1f0cf.png
  24. BIN
      themes/material/img/emojis/large/1f170.png
  25. BIN
      themes/material/img/emojis/large/1f171.png
  26. BIN
      themes/material/img/emojis/large/1f17e.png
  27. BIN
      themes/material/img/emojis/large/1f17f.png
  28. BIN
      themes/material/img/emojis/large/1f18e.png
  29. BIN
      themes/material/img/emojis/large/1f191.png
  30. BIN
      themes/material/img/emojis/large/1f192.png
  31. BIN
      themes/material/img/emojis/large/1f193.png
  32. BIN
      themes/material/img/emojis/large/1f194.png
  33. BIN
      themes/material/img/emojis/large/1f195.png
  34. BIN
      themes/material/img/emojis/large/1f196.png
  35. BIN
      themes/material/img/emojis/large/1f197.png
  36. BIN
      themes/material/img/emojis/large/1f198.png
  37. BIN
      themes/material/img/emojis/large/1f199.png
  38. BIN
      themes/material/img/emojis/large/1f19a.png
  39. BIN
      themes/material/img/emojis/large/1f1e6.png
  40. BIN
      themes/material/img/emojis/large/1f1e7.png
  41. BIN
      themes/material/img/emojis/large/1f1e8-1f1f3.png
  42. BIN
      themes/material/img/emojis/large/1f1e8.png
  43. BIN
      themes/material/img/emojis/large/1f1e9-1f1ea.png
  44. BIN
      themes/material/img/emojis/large/1f1e9.png
  45. BIN
      themes/material/img/emojis/large/1f1ea-1f1f8.png
  46. BIN
      themes/material/img/emojis/large/1f1ea.png
  47. BIN
      themes/material/img/emojis/large/1f1eb-1f1f7.png
  48. BIN
      themes/material/img/emojis/large/1f1eb.png
  49. BIN
      themes/material/img/emojis/large/1f1ec-1f1e7.png
  50. BIN
      themes/material/img/emojis/large/1f1ec.png
  51. BIN
      themes/material/img/emojis/large/1f1ed.png
  52. BIN
      themes/material/img/emojis/large/1f1ee-1f1f9.png
  53. BIN
      themes/material/img/emojis/large/1f1ee.png
  54. BIN
      themes/material/img/emojis/large/1f1ef-1f1f5.png
  55. BIN
      themes/material/img/emojis/large/1f1ef.png
  56. BIN
      themes/material/img/emojis/large/1f1f0-1f1f7.png
  57. BIN
      themes/material/img/emojis/large/1f1f0.png
  58. BIN
      themes/material/img/emojis/large/1f1f1.png
  59. BIN
      themes/material/img/emojis/large/1f1f2.png
  60. BIN
      themes/material/img/emojis/large/1f1f3.png
  61. BIN
      themes/material/img/emojis/large/1f1f4.png
  62. BIN
      themes/material/img/emojis/large/1f1f5.png
  63. BIN
      themes/material/img/emojis/large/1f1f6.png
  64. BIN
      themes/material/img/emojis/large/1f1f7-1f1fa.png
  65. BIN
      themes/material/img/emojis/large/1f1f7.png
  66. BIN
      themes/material/img/emojis/large/1f1f8.png
  67. BIN
      themes/material/img/emojis/large/1f1f9.png
  68. BIN
      themes/material/img/emojis/large/1f1fa-1f1f8.png
  69. BIN
      themes/material/img/emojis/large/1f1fa.png
  70. BIN
      themes/material/img/emojis/large/1f1fb.png
  71. BIN
      themes/material/img/emojis/large/1f1fc.png
  72. BIN
      themes/material/img/emojis/large/1f1fd.png
  73. BIN
      themes/material/img/emojis/large/1f1fe.png
  74. BIN
      themes/material/img/emojis/large/1f1ff.png
  75. BIN
      themes/material/img/emojis/large/1f201.png
  76. BIN
      themes/material/img/emojis/large/1f202.png
  77. BIN
      themes/material/img/emojis/large/1f21a.png
  78. BIN
      themes/material/img/emojis/large/1f22f.png
  79. BIN
      themes/material/img/emojis/large/1f232.png
  80. BIN
      themes/material/img/emojis/large/1f233.png
  81. BIN
      themes/material/img/emojis/large/1f234.png
  82. BIN
      themes/material/img/emojis/large/1f235.png
  83. BIN
      themes/material/img/emojis/large/1f236.png
  84. BIN
      themes/material/img/emojis/large/1f237.png
  85. BIN
      themes/material/img/emojis/large/1f238.png
  86. BIN
      themes/material/img/emojis/large/1f239.png
  87. BIN
      themes/material/img/emojis/large/1f23a.png
  88. BIN
      themes/material/img/emojis/large/1f250.png
  89. BIN
      themes/material/img/emojis/large/1f251.png
  90. BIN
      themes/material/img/emojis/large/1f300.png
  91. BIN
      themes/material/img/emojis/large/1f301.png
  92. BIN
      themes/material/img/emojis/large/1f302.png
  93. BIN
      themes/material/img/emojis/large/1f303.png
  94. BIN
      themes/material/img/emojis/large/1f304.png
  95. BIN
      themes/material/img/emojis/large/1f305.png
  96. BIN
      themes/material/img/emojis/large/1f306.png
  97. BIN
      themes/material/img/emojis/large/1f307.png
  98. BIN
      themes/material/img/emojis/large/1f308.png
  99. BIN
      themes/material/img/emojis/large/1f309.png
  100. BIN
      themes/material/img/emojis/large/1f30a.png

62
app/helpers/StringHelper.php

@ -9,54 +9,7 @@ use HeyUpdate\Emoji\EmojiIndex;
* @param string $string
* @return string
*/
function prepareString($string) {
$smileys =
array(
// HFR icons
":'\(" => 'cry.gif',
':love:'=> 'love.gif',
'O:\)' => 'ange.gif',
'O:-\)' => 'ange.gif',
':redface:' => 'redface.gif',
':petrus:' => 'petrus75.gif',
// famfamfam icons
':\)\)' => 'grin.png',
':\)' => 'smiley.png',
':-\)' => 'smiley.png',
':\(' => 'sad.png',
':o' => 'shocked.png',
':O' => 'shocked.png',
':D' => 'grin.png',
':d' => 'grin.png',
':p' => 'tongue.png',
':P' => 'tongue.png',
':-P' => 'tongue.png',
';D' => 'wink.png',
';d' => 'wink.png',
';\)' => 'wink.png',
'\^\^' => 'happy.png',
'\(k\)' => 'heart.png',
'B\)' => 'cool.png',
':s' => 'confused.png',
':S' => 'confused.png',
':\/' => 'wondering.png',
':evil:'=> 'evil.png',
":\|" => 'neutral.png',
// Meme icons
':okay:' => 'okay.gif',
':trolldad:' => 'trolldad.png',
':epic:' => 'epic.png',
':aloneyeah:' => 'aloneyeah.png',
':fapfap:' => 'fapfap.png',
':megusta:' => 'gusta.png',
':trollface:' => 'trollface.png',
':troll:' => 'trollface.png',
':lol:' => 'trollol.png',
':genius:' => 'genius.png',
);
function prepareString($string, $large = false) {
//replace begin by www
$string = preg_replace_callback(
'/(^|\s|>)(www.[^<> \n\r]+)/ix', function ($match) {
@ -122,6 +75,12 @@ function prepareString($string) {
return '';
}, ' ' . $string
);
//remove all iframe
$string = preg_replace_callback(
'#<[/]?ss[^>]*>#is', function ($match) {
return '';
}, ' ' . $string
);
// We add some smileys...
$cd = new \Modl\ConfigDAO();
@ -130,12 +89,7 @@ function prepareString($string) {
$path = BASE_URI . 'themes/' . $theme . '/img/emojis/';
/*
foreach($smileys as $key => $value) {
$replace = ' <img class="smiley" alt="smiley" src="'.$path.$value.'">';
$string = preg_replace('/(^|[ ])('.$key.')/', $replace, $string);
}*/
if($large) $path .= 'large/';
$emoji = new Emoji(new EmojiIndex(), $path.'%s.png');
$string = $emoji->replaceEmojiWithImages($string);

4
app/models/contact/ContactDAO.php

@ -318,6 +318,7 @@ class ContactDAO extends SQL {
'yahoo' => $contact->yahoo,
'created' => date(DATE_ISO8601),
'updated' => date(DATE_ISO8601),
'jid' => $contact->jid
)
@ -360,7 +361,8 @@ class ContactDAO extends SQL {
'select *, privacy.value as privacy from contact
left outer join privacy
on contact.jid = privacy.pkey
where privacy.value = 1';
where privacy.value = 1
order by created desc';
if($limitr)
$this->_sql = $this->_sql.' limit '.$limitr.' offset '.$limitf;

4
app/views/main.tpl

@ -1,5 +1,3 @@
<?php $this->widget('Init');?>
<nav class="color dark">
<?php $this->widget('Navigation');?>
<?php $this->widget('Presence');?>
@ -11,3 +9,5 @@
<?php $this->widget('Hello');?>
</section>
</main>
<?php $this->widget('Init');?>

30
app/widgets/Chat/Chat.php

@ -87,6 +87,14 @@ class Chat extends WidgetCommon
Dialog::fill($view->draw('_chat_smiley', true));
}
/**
* @brief Get the path of a emoji
*/
function ajaxSmileyGet($string)
{
return prepareString($string, true);
}
/**
* @brief Get a discussion
* @parem string $jid
@ -245,6 +253,8 @@ class Chat extends WidgetCommon
$view->assign('jid', $jid);
$view->assign('messages', $this->prepareMessages($jid));
$jid = echapJS($jid);
$view->assign('composing', $this->call('ajaxSendComposing', "'" . $jid . "'"));
$view->assign('paused', $this->call('ajaxSendPaused', "'" . $jid . "'"));
@ -257,6 +267,8 @@ class Chat extends WidgetCommon
);
$view->assign('smiley', $this->call('ajaxSmiley'));
$view->assign('emoji', prepareString('😀'));
if($muc)
{
$view->assign(
@ -308,15 +320,19 @@ class Chat extends WidgetCommon
$view->assign('me', $me);
$view->assign('message', $message);
$cd = new \Modl\ContactDAO;
$presences = $cd->getPresence($jid);
$contacts = array();
if($message->type == 'groupchat') {
$cd = new \Modl\ContactDAO;
$presences = $cd->getPresence($jid);
$contacts = array();
foreach($presences as $presence) {
$contacts[$presence->resource] = $presence;
}
foreach($presences as $presence) {
$contacts[$presence->resource] = $presence;
}
$view->assign('contacts', $contacts);
$view->assign('contacts', $contacts);
} else {
$view->assign('contacts', array());
}
return $view->draw('_chat_message', true);
}

6
app/widgets/Chat/_chat.tpl

@ -5,10 +5,10 @@
<div id="{$jid}_state"></div>
</div>
<div class="chat_box">
<ul class="simple thin">
<ul class="thin">
<li class="action">
<span class="icon gray">
<i class="md md-create"></i>
<span class="icon gray emojis_open" onclick="Chat_ajaxSmiley()">
{$c->ajaxSmileyGet('😃')}
</span>
<div class="action" onclick="{$send}">
<i class="md md-send"></i>

19
app/widgets/Chat/_chat_message.tpl

@ -1,11 +1,11 @@
{if="$message->body != ''"}
<li {if="$message->jidfrom != $jid"}class="oppose"{/if}>
<span class="icon bubble {if="$contact->updated == null && !array_key_exists($message->resource, $contacts)"}color {$message->resource|stringToColor}{/if}">
<span class="icon bubble {if="empty($contact) && !array_key_exists($message->resource, $contacts)"}color {$message->resource|stringToColor}{/if}">
{if="$message->jidfrom == $jid"}
{if="$contact->updated != null"}
<img src="{$contact->getPhoto('s', $jid)}">
{elseif="array_key_exists($message->resource, $contacts)"}
<img src="{$contacts[$message->resource]->getPhoto('s', $jid)}">
{if="!empty($contacts) && array_key_exists($message->resource, $contacts)"}
<img src="{$contacts[$message->resource]->getPhoto('s')}">
{elseif="isset($contact)"}
<img src="{$contact->getPhoto('s')}">
{else}
{$message->resource|firstLetterCapitalize}
{/if}
@ -13,7 +13,14 @@
<img src="{$me->getPhoto('s')}">
{/if}
</span>
<div class="bubble">
{if="preg_match('#^\/me#', $message->body)"}
{$message->body = '* '.substr($message->body, 3)}
{$class = 'quote'}
{else}
{$class = ''}
{/if}
<div class="bubble {$class}">
{if="preg_match('#^\?OTR#', $message->body)"}
<i class="md md-lock"></i> {$c->__('message.encrypted')}
{else}

85
app/widgets/Chat/_chat_smiley.tpl

@ -1,22 +1,71 @@
<section>
<h3>{$c->__('chat.smileys')}</h3>
<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<table class="emojis">
<tbody>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="😂"><img alt=":joy:" class="emoji" src="themes/material/img/emojis/large/1f602.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😃"><img alt=":smiley:" class="emoji" src="themes/material/img/emojis/large/1f603.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😄"><img alt=":smile:" class="emoji" src="themes/material/img/emojis/large/1f604.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😆"><img alt=":laughing:" class="emoji" src="themes/material/img/emojis/large/1f606.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😍"><img alt=":heart_eyes:" class="emoji" src="themes/material/img/emojis/large/1f60d.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😉"><img alt=":wink:" class="emoji" src="themes/material/img/emojis/large/1f609.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="😠"><img alt=":angry:" class="emoji" src="themes/material/img/emojis/large/1f620.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😜"><img alt=":stuck_out_tongue_winking_eye:" class="emoji" src="themes/material/img/emojis/large/1f61c.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😝"><img alt=":stuck_out_tongue_closed_eyes:" class="emoji" src="themes/material/img/emojis/large/1f61d.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😒"><img alt=":unamused:" class="emoji" src="themes/material/img/emojis/large/1f612.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😓"><img alt=":sweat:" class="emoji" src="themes/material/img/emojis/large/1f613.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😖"><img alt=":confounded:" class="emoji" src="themes/material/img/emojis/large/1f616.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="😢"><img alt=":cry:" class="emoji" src="themes/material/img/emojis/large/1f622.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😤"><img alt=":triumph:" class="emoji" src="themes/material/img/emojis/large/1f624.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😥"><img alt=":disappointed_relieved:" class="emoji" src="themes/material/img/emojis/large/1f625.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😪"><img alt=":sleepy:" class="emoji" src="themes/material/img/emojis/large/1f62a.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😭"><img alt=":sob:" class="emoji" src="themes/material/img/emojis/large/1f62d.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="😱"><img alt=":scream:" class="emoji" src="themes/material/img/emojis/large/1f631.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="🍌"><img alt=":banana:" class="emoji" src="themes/material/img/emojis/large/1f34c.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍎"><img alt=":apple:" class="emoji" src="themes/material/img/emojis/large/1f34e.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🌼"><img alt=":blossom:" class="emoji" src="themes/material/img/emojis/large/1f33c.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🌵"><img alt=":cactus:" class="emoji" src="themes/material/img/emojis/large/1f335.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🌹"><img alt=":rose:" class="emoji" src="themes/material/img/emojis/large/1f339.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍄"><img alt=":mushroom:" class="emoji" src="themes/material/img/emojis/large/1f344.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="🍔"><img alt=":hamburger:" class="emoji" src="themes/material/img/emojis/large/1f354.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍕"><img alt=":pizza:" class="emoji" src="themes/material/img/emojis/large/1f355.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍗"><img alt=":poultry_leg:" class="emoji" src="themes/material/img/emojis/large/1f357.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍚"><img alt=":rice:" class="emoji" src="themes/material/img/emojis/large/1f35a.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍜"><img alt=":ramen:" class="emoji" src="themes/material/img/emojis/large/1f35c.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🍣"><img alt=":sushi:" class="emoji" src="themes/material/img/emojis/large/1f363.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="💋"><img alt=":kiss:" class="emoji" src="themes/material/img/emojis/large/1f48b.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="💊"><img alt=":pill:" class="emoji" src="themes/material/img/emojis/large/1f48a.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="💡"><img alt=":bulb:" class="emoji" src="themes/material/img/emojis/large/1f4a1.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="💩"><img alt=":hankey:" class="emoji" src="themes/material/img/emojis/large/1f4a9.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="☕"><img alt=":coffee:" class="emoji" src="themes/material/img/emojis/large/2615.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="⏰"><img alt=":alarm_clock:" class="emoji" src="themes/material/img/emojis/large/23f0.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="🛀"><img alt=":bath:" class="emoji" src="themes/material/img/emojis/large/1f6c0.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🎧"><img alt=":headphones:" class="emoji" src="themes/material/img/emojis/large/1f3a7.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🎮"><img alt=":video_game:" class="emoji" src="themes/material/img/emojis/large/1f3ae.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🎫"><img alt=":ticket:" class="emoji" src="themes/material/img/emojis/large/1f3ab.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="💼"><img alt=":briefcase:" class="emoji" src="themes/material/img/emojis/large/1f4bc.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🎒"><img alt=":school_satchel:" class="emoji" src="themes/material/img/emojis/large/1f392.png"></td>
</tr>
<tr class="active">
<td onclick="Chat.addSmiley(this);" data-emoji="🐷"><img alt=":pig:" class="emoji" src="themes/material/img/emojis/large/1f437.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🐵"><img alt=":monkey_face:" class="emoji" src="themes/material/img/emojis/large/1f435.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🐶"><img alt=":dog:" class="emoji" src="themes/material/img/emojis/large/1f436.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🐸"><img alt=":frog:" class="emoji" src="themes/material/img/emojis/large/1f438.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🐹"><img alt=":hamster:" class="emoji" src="themes/material/img/emojis/large/1f439.png"></td>
<td onclick="Chat.addSmiley(this);" data-emoji="🐻"><img alt=":bear:" class="emoji" src="themes/material/img/emojis/large/1f43b.png"></td>
</tr>
</tbody>
</table>
</section>
<div>

18
app/widgets/Chat/chat.css

@ -39,6 +39,24 @@
margin-bottom: 1rem;
}
#chat_widget .emojis_open img {
width: 36px;
margin: 0.2rem;
}
table.emojis td {
width: 10%;
text-align: center;
padding: 1rem 0;
}
#chat_widget .emojis_open:hover,
table.emojis td:hover {
cursor: pointer;
background-color: rgba(0, 0, 0, 0.05);
border-radius: 0.5rem;
}
@media screen and (max-width: 1024px) {
#chat_widget .chat_box {
width: 100%;

14
app/widgets/Chat/chat.js

@ -1,10 +1,9 @@
var Chat = {
/*
message: function(jid, html) {
movim_append('messages' + jid, html);
},*/
addSmiley: function(smiley) {
addSmiley: function(element) {
var n = document.querySelector('#chat_textarea');
n.value = n.value + element.dataset.emoji;
n.focus();
Dialog.clear();
},
sendMessage: function(jid)
{
@ -14,6 +13,9 @@ var Chat = {
n.focus();
return encodeURIComponent(text);
},
appendTextarea: function(value)
{
},
notify : function(title, body, image)
{
if(document_focus == false) {

12
app/widgets/Chats/Chats.php

@ -32,8 +32,11 @@ class Chats extends WidgetCommon
$this->ajaxOpen($from);
} else {
// TODO notification overwrite issue
//RPC::call('movim_replace', $from, $this->prepareChat($from));
RPC::call('movim_replace', $from.'_chat_item', $this->prepareChat($from));
RPC::call('Chats.refresh');
$n = new Notification;
$n->ajaxGet();
}
}
}
@ -45,8 +48,11 @@ class Chats extends WidgetCommon
$c = $contacts[0];
$chats = Cache::c('chats');
if(array_key_exists($c->jid, $chats)) {
RPC::call('movim_replace', $c->jid, $this->prepareChat($c->jid));
RPC::call('movim_replace', $c->jid.'_chat_item', $this->prepareChat($c->jid));
RPC::call('Chats.refresh');
$n = new Notification;
$n->ajaxGet();
}
}
}
@ -78,7 +84,7 @@ class Chats extends WidgetCommon
unset($chats[$jid]);
Cache::c('chats', $chats);
RPC::call('movim_delete', $jid);
RPC::call('movim_delete', $jid.'_chat_item');
RPC::call('Chats.refresh');
RPC::call('Chat.empty');

4
app/widgets/Chats/_chats_item.tpl

@ -1,5 +1,5 @@
<li
id="{$contact->jid}"
id="{$contact->jid}_chat_item"
data-jid="{$contact->jid}"
{if="isset($message)"}class="condensed"{/if}
title="{$contact->jid}">
@ -13,7 +13,7 @@
{if="preg_match('#^\?OTR#', $message->body)"}
<p><i class="md md-lock"></i> {$c->__('message.encrypted')}</p>
{else}
<p>{$message->body|htmlentities}</p>
<p>{$message->body|prepareString}</p>
{/if}
{/if}
</li>

4
app/widgets/Chats/chats.js

@ -46,6 +46,10 @@ var Chats = {
}
}
movim_add_onload(function(){
Notification.current('chat');
});
MovimWebsocket.attach(function() {
Chats.refresh();
});

1
app/widgets/Init/init.js

@ -20,6 +20,7 @@ var Init = {
var username = localStorage.getItem("username");
if(username == null) return;
var jid = username.replace("@", "at");
var init = localStorage.getObject(jid + "_Init") || {};
init.initialized = 'true';
localStorage.setObject(jid + "_Init", init);

4
app/widgets/Notification/notification.js

@ -35,7 +35,6 @@ var Notification = {
Notification.setTab(key, counter);
}
Notification.document_title = document.title;
Notification.displayTab();
},
counter : function(key, counter) {
@ -109,13 +108,14 @@ var Notification = {
}
MovimWebsocket.attach(function() {
Notification.document_title = document.title;
Notification_ajaxGet();
Notification.current(Notification.notifs_key);
});
document.onblur = function() {
Notification.focused = false;
Notification_ajaxCurrent();
Notification_ajaxCurrent('blurred');
}
document.onfocus = function() {
Notification.focused = true;

2
app/widgets/Post/_post_preview.tpl

@ -4,7 +4,7 @@
<article>
<section>
<content>
{$content}
{$content|prepareString}
</content>
</section>
</article>

1
app/widgets/Presence/Presence.php

@ -172,6 +172,7 @@ class Presence extends WidgetBase
$presencetpl->assign('me', $contact);
$presencetpl->assign('presence', $presence);
$presencetpl->assign('presencetxt', getPresencesTxt());
$presencetpl->assign('dialog', $this->call('ajaxOpenDialog'));
$html = $presencetpl->draw('_presence', true);

2
app/widgets/Presence/_presence.tpl

@ -2,7 +2,7 @@
<div class="action">
<i class="md md-edit"></i>
</div>
<span class="icon bubble" style="background-image: url({$me->getPhoto('m')})"></span>
<span class="icon bubble status {$presencetxt[$presence->value]}" style="background-image: url({$me->getPhoto('m')})"></span>
<span>{$me->getTrueName()}</span>
<p class="wrap">{$presence->status}</p>
</li>

2
app/widgets/Roster/roster.js

@ -317,8 +317,8 @@ var Roster = {
MovimWebsocket.attach(function() {
Roster_ajaxGetRoster();
Notification.notifs_key = 'contacts';
Roster.refresh();
Notification.current('contacts');
});

6
linker.php

@ -45,7 +45,7 @@ $connector($config->websocketurl, array('xmpp'))->then(function($conn) use (&$st
$conn->on('message', function($message) use ($conn, $loop) {
if($message != '') {
#fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
if($message == '</stream:stream>') {
$conn->close();
@ -76,7 +76,7 @@ $connector($config->websocketurl, array('xmpp'))->then(function($conn) use (&$st
}
if(!empty($xml)) {
#fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
$conn->send(trim($xml));
}
}
@ -118,7 +118,7 @@ $connector($config->websocketurl, array('xmpp'))->then(function($conn) use (&$st
\Moxl\API::clear();
if(!empty($xml)) {
#fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
$conn->send(trim($xml));
}

10
system/widget/WidgetWrapper.php

@ -167,10 +167,14 @@ class WidgetWrapper
$session = Session::start();
$notifs_key = $session->get('notifs_key');
$explode = explode('|', $notifs_key);
$key = reset($explode);
if($key == $widget->filters[$method]) {
if($notifs_key == 'blurred') {
$widget->{$method}($data);
} else {
$explode = explode('|', $notifs_key);
$notif_key = reset($explode);
if($notif_key == $widget->filters[$method]) {
$widget->{$method}($data);
}
}
} else {
$widget->{$method}($data);

4
themes/material/css/list.css

@ -168,6 +168,10 @@ ul li div.bubble {
/*word-break: break-all;*/
}
ul li div.bubble.quote {
font-style: italic;
}
ul li.oppose div.bubble {
margin-left: 2rem;
float: right;

BIN
themes/material/img/emojis/large/1f004.png

After

Width: 36  |  Height: 36  |  Size: 342 B

BIN
themes/material/img/emojis/large/1f0cf.png

After

Width: 36  |  Height: 36  |  Size: 630 B

BIN
themes/material/img/emojis/large/1f170.png

After

Width: 36  |  Height: 36  |  Size: 358 B

BIN
themes/material/img/emojis/large/1f171.png

After

Width: 36  |  Height: 36  |  Size: 308 B

BIN
themes/material/img/emojis/large/1f17e.png

After

Width: 36  |  Height: 36  |  Size: 337 B

BIN
themes/material/img/emojis/large/1f17f.png

After

Width: 36  |  Height: 36  |  Size: 267 B

BIN
themes/material/img/emojis/large/1f18e.png

After

Width: 36  |  Height: 36  |  Size: 412 B

BIN
themes/material/img/emojis/large/1f191.png

After

Width: 36  |  Height: 36  |  Size: 353 B

BIN
themes/material/img/emojis/large/1f192.png

After

Width: 36  |  Height: 36  |  Size: 313 B

BIN
themes/material/img/emojis/large/1f193.png

After

Width: 36  |  Height: 36  |  Size: 331 B

BIN
themes/material/img/emojis/large/1f194.png

After

Width: 36  |  Height: 36  |  Size: 314 B

BIN
themes/material/img/emojis/large/1f195.png

After

Width: 36  |  Height: 36  |  Size: 369 B

BIN
themes/material/img/emojis/large/1f196.png

After

Width: 36  |  Height: 36  |  Size: 385 B

BIN
themes/material/img/emojis/large/1f197.png

After

Width: 36  |  Height: 36  |  Size: 366 B

BIN
themes/material/img/emojis/large/1f198.png

After

Width: 36  |  Height: 36  |  Size: 426 B

BIN
themes/material/img/emojis/large/1f199.png

After

Width: 36  |  Height: 36  |  Size: 347 B

BIN
themes/material/img/emojis/large/1f19a.png

After

Width: 36  |  Height: 36  |  Size: 459 B

BIN
themes/material/img/emojis/large/1f1e6.png

After

Width: 36  |  Height: 36  |  Size: 358 B

BIN
themes/material/img/emojis/large/1f1e7.png

After

Width: 36  |  Height: 36  |  Size: 306 B

BIN
themes/material/img/emojis/large/1f1e8-1f1f3.png

After

Width: 36  |  Height: 36  |  Size: 269 B

BIN
themes/material/img/emojis/large/1f1e8.png

After

Width: 36  |  Height: 36  |  Size: 316 B

BIN
themes/material/img/emojis/large/1f1e9-1f1ea.png

After

Width: 36  |  Height: 36  |  Size: 165 B

BIN
themes/material/img/emojis/large/1f1e9.png

After

Width: 36  |  Height: 36  |  Size: 310 B

BIN
themes/material/img/emojis/large/1f1ea-1f1f8.png

After

Width: 36  |  Height: 36  |  Size: 259 B

BIN
themes/material/img/emojis/large/1f1ea.png

After

Width: 36  |  Height: 36  |  Size: 217 B

BIN
themes/material/img/emojis/large/1f1eb-1f1f7.png

After

Width: 36  |  Height: 36  |  Size: 158 B

BIN
themes/material/img/emojis/large/1f1eb.png

After

Width: 36  |  Height: 36  |  Size: 254 B

BIN
themes/material/img/emojis/large/1f1ec-1f1e7.png

After

Width: 36  |  Height: 36  |  Size: 445 B

BIN
themes/material/img/emojis/large/1f1ec.png

After

Width: 36  |  Height: 36  |  Size: 359 B

BIN
themes/material/img/emojis/large/1f1ed.png

After

Width: 36  |  Height: 36  |  Size: 208 B

BIN
themes/material/img/emojis/large/1f1ee-1f1f9.png

After

Width: 36  |  Height: 36  |  Size: 158 B

BIN
themes/material/img/emojis/large/1f1ee.png

After

Width: 36  |  Height: 36  |  Size: 209 B

BIN
themes/material/img/emojis/large/1f1ef-1f1f5.png

After

Width: 36  |  Height: 36  |  Size: 227 B

BIN
themes/material/img/emojis/large/1f1ef.png

After

Width: 36  |  Height: 36  |  Size: 255 B

BIN
themes/material/img/emojis/large/1f1f0-1f1f7.png

After

Width: 36  |  Height: 36  |  Size: 490 B

BIN
themes/material/img/emojis/large/1f1f0.png

After

Width: 36  |  Height: 36  |  Size: 309 B

BIN
themes/material/img/emojis/large/1f1f1.png

After

Width: 36  |  Height: 36  |  Size: 235 B

BIN
themes/material/img/emojis/large/1f1f2.png

After

Width: 36  |  Height: 36  |  Size: 427 B

BIN
themes/material/img/emojis/large/1f1f3.png

After

Width: 36  |  Height: 36  |  Size: 310 B

BIN
themes/material/img/emojis/large/1f1f4.png

After

Width: 36  |  Height: 36  |  Size: 320 B

BIN
themes/material/img/emojis/large/1f1f5.png

After

Width: 36  |  Height: 36  |  Size: 306 B

BIN
themes/material/img/emojis/large/1f1f6.png

After

Width: 36  |  Height: 36  |  Size: 357 B

BIN
themes/material/img/emojis/large/1f1f7-1f1fa.png

After

Width: 36  |  Height: 36  |  Size: 167 B

BIN
themes/material/img/emojis/large/1f1f7.png

After

Width: 36  |  Height: 36  |  Size: 319 B

BIN
themes/material/img/emojis/large/1f1f8.png

After

Width: 36  |  Height: 36  |  Size: 331 B

BIN
themes/material/img/emojis/large/1f1f9.png

After

Width: 36  |  Height: 36  |  Size: 247 B

BIN
themes/material/img/emojis/large/1f1fa-1f1f8.png

After

Width: 36  |  Height: 36  |  Size: 205 B

BIN
themes/material/img/emojis/large/1f1fa.png

After

Width: 36  |  Height: 36  |  Size: 293 B

BIN
themes/material/img/emojis/large/1f1fb.png

After

Width: 36  |  Height: 36  |  Size: 348 B

BIN
themes/material/img/emojis/large/1f1fc.png

After

Width: 36  |  Height: 36  |  Size: 431 B

BIN
themes/material/img/emojis/large/1f1fd.png

After

Width: 36  |  Height: 36  |  Size: 366 B

BIN
themes/material/img/emojis/large/1f1fe.png

After

Width: 36  |  Height: 36  |  Size: 304 B

BIN
themes/material/img/emojis/large/1f1ff.png

After

Width: 36  |  Height: 36  |  Size: 318 B

BIN
themes/material/img/emojis/large/1f201.png

After

Width: 36  |  Height: 36  |  Size: 243 B

BIN
themes/material/img/emojis/large/1f202.png

After

Width: 36  |  Height: 36  |  Size: 301 B

BIN
themes/material/img/emojis/large/1f21a.png

After

Width: 36  |  Height: 36  |  Size: 365 B

BIN
themes/material/img/emojis/large/1f22f.png

After

Width: 36  |  Height: 36  |  Size: 371 B

BIN
themes/material/img/emojis/large/1f232.png

After

Width: 36  |  Height: 36  |  Size: 424 B

BIN
themes/material/img/emojis/large/1f233.png

After

Width: 36  |  Height: 36  |  Size: 345 B

BIN
themes/material/img/emojis/large/1f234.png

After

Width: 36  |  Height: 36  |  Size: 341 B

BIN
themes/material/img/emojis/large/1f235.png

After

Width: 36  |  Height: 36  |  Size: 393 B

BIN
themes/material/img/emojis/large/1f236.png

After

Width: 36  |  Height: 36  |  Size: 327 B

BIN
themes/material/img/emojis/large/1f237.png

After

Width: 36  |  Height: 36  |  Size: 297 B

BIN
themes/material/img/emojis/large/1f238.png

After

Width: 36  |  Height: 36  |  Size: 289 B

BIN
themes/material/img/emojis/large/1f239.png

After

Width: 36  |  Height: 36  |  Size: 361 B

BIN
themes/material/img/emojis/large/1f23a.png

After

Width: 36  |  Height: 36  |  Size: 359 B

BIN
themes/material/img/emojis/large/1f250.png

After

Width: 36  |  Height: 36  |  Size: 515 B

BIN
themes/material/img/emojis/large/1f251.png

After

Width: 36  |  Height: 36  |  Size: 410 B

BIN
themes/material/img/emojis/large/1f300.png

After

Width: 36  |  Height: 36  |  Size: 514 B

BIN
themes/material/img/emojis/large/1f301.png

After

Width: 36  |  Height: 36  |  Size: 470 B

BIN
themes/material/img/emojis/large/1f302.png

After

Width: 36  |  Height: 36  |  Size: 534 B

BIN
themes/material/img/emojis/large/1f303.png

After

Width: 36  |  Height: 36  |  Size: 354 B

BIN
themes/material/img/emojis/large/1f304.png

After

Width: 36  |  Height: 36  |  Size: 676 B

BIN
themes/material/img/emojis/large/1f305.png

After

Width: 36  |  Height: 36  |  Size: 509 B

BIN
themes/material/img/emojis/large/1f306.png

After

Width: 36  |  Height: 36  |  Size: 277 B

BIN
themes/material/img/emojis/large/1f307.png

After

Width: 36  |  Height: 36  |  Size: 532 B

BIN
themes/material/img/emojis/large/1f308.png

After

Width: 36  |  Height: 36  |  Size: 857 B

BIN
themes/material/img/emojis/large/1f309.png

After

Width: 36  |  Height: 36  |  Size: 418 B

BIN
themes/material/img/emojis/large/1f30a.png

After

Width: 36  |  Height: 36  |  Size: 488 B

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save