Browse Source

- Merge with edhelas & nodpounod

pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
846bd3e384
  1. 56
      app/models/contact/Contact.php
  2. 30
      app/widgets/Chat/_chat_message.tpl
  3. 18
      app/widgets/Chats/_chats_item.tpl
  4. 2
      app/widgets/Contact/Contact.php
  5. 22
      app/widgets/Contact/_contact.tpl
  6. 14
      app/widgets/Contact/_contact_explore.tpl
  7. 14
      app/widgets/Hello/hello.tpl
  8. 13
      app/widgets/Login/_login_sessions.tpl
  9. 14
      app/widgets/Menu/_menu_list.tpl
  10. 13
      app/widgets/Post/_post.tpl
  11. 12
      app/widgets/Presence/_presence.tpl
  12. 13
      app/widgets/Rooms/_rooms_list.tpl
  13. 1
      app/widgets/Roster/Roster.php
  14. 212
      app/widgets/Roster/img/movim_cloud.svg
  15. 11
      app/widgets/Roster/roster.css
  16. 4
      app/widgets/Roster/roster.js
  17. 14
      app/widgets/Roster/roster.tpl
  18. 13
      app/widgets/Statistics/statistics.tpl
  19. 9
      themes/material/css/list.css
  20. 2
      themes/material/css/style.css
  21. BIN
      themes/material/img/favicon.ico

56
app/models/contact/Contact.php

@ -197,45 +197,33 @@ class Contact extends Model {
}
}
public function isPhoto($jid = false, $x = false, $y = false) {
if(!$jid) return false;
$p = new \Picture;
$url = $p->get($jid, $sizes[$size][0], $sizes[$size][1]);
if($url) return $url;
return false;
}
public function getPhoto($size = 'l', $jid = false) {
if($size == 'email') {
return BASE_URI.'cache/'.strtolower($this->jid).'_email.jpg';
} else {
if($jid)
$jid = strtolower($jid);
else
$jid = $this->jid;
if(isset($jid)) {
$sizes = array(
'wall' => array(1920, 1080),
'xxl' => array(1280, 300),
'l' => array(210 , false),
'm' => array(120 , false),
's' => array(50 , false),
'xs' => array(28 , false),
'xxs' => array(24 , false)
);
$p = new \Picture;
if($p->get($jid, $sizes[$size][0], $sizes[$size][1])) {
return $p->get($jid, $sizes[$size][0], $sizes[$size][1]);
} else {
$out = base_convert($jid, 32, 8);
if($out == false)
$out[3] = 1;
return BASE_URI.'/themes/movim/img/default'.$out[3].'.svg';
}
} else {
$out = base_convert(md5(openssl_random_pseudo_bytes(5)), 16, 8);
$sizes = array(
'wall' => array(1920, 1080),
'xxl' => array(1280, 300),
'l' => array(210 , false),
'm' => array(120 , false),
's' => array(50 , false),
'xs' => array(28 , false),
'xxs' => array(24 , false)
);
if($out == false)
$out[4] = 1;
return BASE_URI.'/themes/movim/img/default'.$out[4].'.svg';
}
$p = new \Picture;
return $p->get($this->jid, $sizes[$size][0], $sizes[$size][1]);
}
}

30
app/widgets/Chat/_chat_message.tpl

@ -1,18 +1,26 @@
{if="$message->body != ''"}
<li {if="$message->jidfrom != $jid"}class="oppose"{/if}>
<span class="icon bubble {if="empty($contact) && !array_key_exists($message->resource, $contacts)"}color {$message->resource|stringToColor}{/if}">
{if="$message->jidfrom == $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}
{if="$message->jidfrom == $jid"}
{$url = $contact->getPhoto('s')}
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{elseif="$message->type == 'groupchat'"}
<span class="icon bubble color {$message->resource|stringToColor}">
<i class="md md-person"></i>
</span>
{else}
<img src="{$me->getPhoto('s')}">
<span class="icon bubble color {$contact->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
</span>
{else}
<span class="icon bubble">
<img src="{$me->getPhoto('s')}">
</span>
{/if}
{if="preg_match('#^\/me#', $message->body)"}
{$message->body = '* '.substr($message->body, 3)}
{$class = 'quote'}

18
app/widgets/Chats/_chats_item.tpl

@ -1,12 +1,22 @@
<li
id="{$contact->jid}_chat_item"
data-jid="{$contact->jid}"
{if="isset($message)"}class="condensed"{/if}
class="
{if="isset($message)"}condensed{/if}
{if="$contact->last > 60"} inactive{/if}
"
title="{$contact->jid}">
<span data-key="chat|{$contact->jid}" class="counter bottom"></span>
<span class="icon bubble {if="isset($presence)"}status {$presence}{/if}">
<img src="{$contact->getPhoto('s')}">
</span>
{$url = $contact->getPhoto('s')}
{if="$url"}
<span class="icon bubble {if="isset($presence)"}status {$presence}{/if}">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$contact->jid|stringToColor} {if="isset($presence)"}status {$presence}{/if}">
<i class="md md-person"></i>
</span>
{/if}
<span>{$contact->getTrueName()}</span>
{if="isset($message)"}
<span class="info">{$message->delivered|strtotime|prepareDate}</span>

2
app/widgets/Contact/Contact.php

@ -147,7 +147,7 @@ class Contact extends WidgetCommon
$cd = new \Modl\ContactDAO;
$c = $cd->get($jid, true);
if($c == null) {
if($c == null || $c->created == null) {
$c = new \Modl\Contact;
$c->jid = $jid;

22
app/widgets/Contact/_contact.tpl

@ -1,8 +1,24 @@
{if="$contact != null"}
<header class="big" style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%), url('{$contact->getPhoto('xxl')}');">
{$url = $contact->getPhoto('s')}
<header class="big"
{if="$url"}
style="background-image: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%), url('{$contact->getPhoto('xxl')}');"
{else}
style="background-color: rgba(62,81,181,1);"
{/if}
>
<ul class="thick">
<li class="">
<span class="icon bubble"><img src="{$contact->getPhoto('l')}"></span>
<li>
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$contact->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
<span>
<h2>{$contact->getTrueName()}</h2>
</span>

14
app/widgets/Contact/_contact_explore.tpl

@ -4,9 +4,17 @@
<ul class="flex card active thick">
{loop="$users"}
<li class="{if="$value->description != ''"}condensed{/if} block" style="background-image: url();" onclick="Contact_ajaxGetContact('{$value->jid}');">
<span class="icon bubble">
<img src="{$value->getPhoto('m')}"/>
</span>
{$url = $value->getPhoto('s')}
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$value->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
<span>{$value->getTrueName()}</span>
{if="$value->getAge()"}

14
app/widgets/Hello/hello.tpl

@ -4,9 +4,17 @@
{loop="$top"}
<li class="block action {if="$value->getPlace()"}condensed{/if}"
onclick="Hello_ajaxChat('{$value->jid}')">
<span class="icon bubble">
<img src="{$value->getPhoto('s')}">
</span>
{$url = $value->getPhoto('s')}
{if="$url"}
<span class="icon bubble {if="isset($presence)"}status {$presence}{/if}">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$value->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
<span>{$value->getTrueName()}</span>
<p class="wrap">{$value->getPlace()}</p>
</li>

13
app/widgets/Login/_login_sessions.tpl

@ -7,9 +7,16 @@
<div class="action">
<i class="md md-close"></i>
</div>
<span class="icon bubble">
<img src="{$value->getPhoto('s')}"/>
</span>
{$url = $value->getPhoto('s')}
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$value->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
<span>{$value->getTrueName()}</span>
</li>
{/loop}

14
app/widgets/Menu/_menu_list.tpl

@ -17,10 +17,16 @@
<i class="md md-warning"></i>
</span>
{elseif="$value->node == 'urn:xmpp:microblog:0'"}
<span class="icon bubble">
<!--<i class="md md-create"></i>-->
<img src="{$value->getContact()->getPhoto('s')}">
</span>
{$url = $value->getContact()->getPhoto('s')}
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$value->getContact()->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
{else}
<span class="icon bubble color {$value->node|stringToColor}">{$value->node|firstLetterCapitalize}</span>
{/if}

13
app/widgets/Post/_post.tpl

@ -11,9 +11,16 @@
<ul class="thick">
<li class="condensed">
{if="$post->node == 'urn:xmpp:microblog:0'"}
<span class="icon bubble">
<img src="{$post->getContact()->getPhoto('s')}">
</span>
{$url = $post->getContact()->getPhoto('s')}
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$post->getContact()->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
{else}
<!--<a href="{$c->route('node', array($post->jid, $post->node))}">-->
<span class="icon bubble color {$post->node|stringToColor}">{$post->node|firstLetterCapitalize}</span>

12
app/widgets/Presence/_presence.tpl

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

13
app/widgets/Rooms/_rooms_list.tpl

@ -5,9 +5,16 @@
{$presence = getPresencesTxt()}
{loop="$list"}
<li class="action">
<span class="icon bubble status {$presence[$value->value]}">
<img src="{$value->getPhoto('s')}" />
</span>
{$url = $value->getPhoto('s')}
{if="$url"}
<span class="icon bubble status {$presence[$value->value]}">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$value->resource|stringToColor} status {$presence[$value->value]}">
<i class="md md-person"></i>
</span>
{/if}
{if="$value->mucaffiliation =='owner'"}
<div class="action">
<i class="md md-beenhere"></i>

1
app/widgets/Roster/Roster.php

@ -284,6 +284,7 @@ class Roster extends WidgetBase
// We add some basic information
$c['rosterview'] = array();
$c['rosterview']['avatar'] = $oc->getPhoto('s');
$c['rosterview']['color'] = stringToColor($oc->jid);
$c['rosterview']['name'] = $oc->getTrueName();
$c['rosterview']['friendpage'] = $this->route('friend', $oc->jid);

212
app/widgets/Roster/img/movim_cloud.svg

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96.591591"
height="58.824287"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="movim_cloud.svg">
<defs
id="defs4">
<linearGradient
gradientTransform="translate(-528.19131,-29.686872)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3661"
id="linearGradient3667"
y2="533.03644"
x2="435.07819"
y1="633.30017"
x1="435.07819" />
<linearGradient
gradientTransform="translate(-17.8297,209.72444)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3206"
id="linearGradient4132"
y2="594.27252"
x2="93.106339"
y1="594.27252"
x1="-29.295137" />
<linearGradient
gradientTransform="translate(0,-6.4083621)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient4070"
id="linearGradient4120"
y2="615.46869"
x2="75.276634"
y1="615.46869"
x1="-47.124844" />
<linearGradient
gradientTransform="translate(-17.8297,209.72444)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3206"
id="linearGradient4118"
y2="594.27252"
x2="93.106339"
y1="594.27252"
x1="-29.295137" />
<linearGradient
gradientTransform="translate(-17.8297,115.46027)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3206"
id="linearGradient4116"
y2="594.27252"
x2="93.106339"
y1="594.27252"
x1="-29.295137" />
<linearGradient
gradientTransform="translate(0,-6.4083621)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient4070"
id="linearGradient4076"
y2="615.46869"
x2="75.276634"
y1="615.46869"
x1="-47.124844" />
<linearGradient
gradientTransform="translate(-17.8297,209.72444)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3206"
id="linearGradient3260"
y2="594.27252"
x2="93.106339"
y1="594.27252"
x1="-29.295137" />
<linearGradient
gradientTransform="translate(-17.8297,115.46027)"
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3206"
id="linearGradient3224"
y2="594.27252"
x2="93.106339"
y1="594.27252"
x1="-29.295137" />
<linearGradient
gradientUnits="userSpaceOnUse"
xlink:href="#linearGradient3312"
id="linearGradient3320"
y2="173.15828"
x2="404.92435"
y1="173.15828"
x1="131.90559" />
<linearGradient
id="linearGradient3312">
<stop
offset="0"
style="stop-color:#b9c1ff;stop-opacity:1"
id="stop3314" />
<stop
offset="1"
style="stop-color:#b9c1ff;stop-opacity:0.54887217"
id="stop3316" />
</linearGradient>
<linearGradient
id="linearGradient3187">
<stop
offset="0"
style="stop-color:#ffff00;stop-opacity:1"
id="stop3189" />
<stop
offset="1"
style="stop-color:#ffff00;stop-opacity:0"
id="stop3191" />
</linearGradient>
<linearGradient
id="linearGradient3206">
<stop
offset="0"
style="stop-color:#909090;stop-opacity:1"
id="stop3208" />
<stop
offset="1"
style="stop-color:#6f6f6f;stop-opacity:0"
id="stop3210" />
</linearGradient>
<linearGradient
id="linearGradient4070">
<stop
offset="0"
style="stop-color:#989898;stop-opacity:1"
id="stop4072" />
<stop
offset="1"
style="stop-color:#989898;stop-opacity:0"
id="stop4074" />
</linearGradient>
<linearGradient
id="linearGradient3661">
<stop
offset="0"
style="stop-color:#2a5faf;stop-opacity:1"
id="stop3663" />
<stop
offset="1"
style="stop-color:#84aeec;stop-opacity:1"
id="stop3665" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="120.57711"
inkscape:cy="-68.910547"
inkscape:document-units="px"
inkscape:current-layer="layer1-1"
showgrid="false"
inkscape:window-width="1871"
inkscape:window-height="1056"
inkscape:window-x="1969"
inkscape:window-y="24"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-99.070922,-102.6903)">
<g
id="layer1-8"
transform="translate(916.37579,-480.7047)">
<g
id="layer1-1"
transform="matrix(0.21011019,0,0,0.21011019,616.04715,830.41892)">
<path
style="fill:none; stroke-opacity:1; stroke:#dddddd; stroke-width: 28.55644417; stroke-dasharray: 600;"
id="path3053"
d="m -6641.655,-1161.4187 c -49.1292,0 -88.9559,39.8269 -88.9559,88.9559 0,3.8181 0.2561,7.5949 0.7227,11.2863 -0.7036,-0.019 -1.4042,-0.056 -2.1127,-0.056 -41.7597,0 -75.6125,33.8528 -75.6125,75.61241 0,41.75961 33.8528,75.61247 75.6125,75.61247 l 293.2763,0 c 34.3902,0 62.2692,-27.87881 62.2692,-62.26909 0,-34.39029 -27.879,-62.26909 -62.2692,-62.26909 -0.1124,0 -0.2225,-6e-4 -0.3335,0 0.08,-1.5529 0.1673,-3.0972 0.1673,-4.6702 0,-49.1289 -39.827,-88.9558 -88.956,-88.9558 -13.7113,0 -26.7078,3.1324 -38.3065,8.6732 -15.7124,-25.1679 -43.6455,-41.9205 -75.5015,-41.9205 z"
inkscape:connector-curvature="0" >
<animate attributeName="stroke-dashoffset" dur="1000ms" from="0" to="1200" repeatCount="indefinite"/>
</path>
</g>
</g>
</g>
</svg>

11
app/widgets/Roster/roster.css

@ -64,10 +64,6 @@
background-color: #DDD;
}
#roster ul#rosterlist li.inactive {
opacity: 0.5;
}
/* Search */
#roster ul li.subheader.search,
#roster.search ul#rosterlist div.groupshown > li {
@ -78,3 +74,10 @@
#roster.search ul#rosterlist div > li.found {
display: list-item;
}
#roster ul#rosterlist > div#spinner{
width: 150px;
position: relative;
margin: 50% auto;
overflow: visible;
}

4
app/widgets/Roster/roster.js

@ -16,6 +16,8 @@
$scope.lookupjid = {};
$scope.initContacts = function(list){
document.getElementById("spinner").style.display = "block";
/* Sort groups alphabetically */
list.sort(groupnameCompare);
@ -30,6 +32,8 @@
$scope.lookupjid[$scope.contacts[i].agroupitems[j].ajid] = $scope.contacts[i].agroupitems[j];
}
}
document.getElementById("spinner").style.display = "none";
$scope.$apply();
};

14
app/widgets/Roster/roster.tpl

@ -10,11 +10,17 @@
</span>
<li class="subheader search">{$c->__('roster.results')}</li>
<div id="spinner">
<object data="app/widgets/Roster/img/movim_cloud.svg" type="image/svg+xml"></object>
</div>
<div
ng-if="contacts != null && !group.tombstone"
ng-repeat="group in contacts"
id="group{{::group.agroup}}"
ng-class="{groupshown: rosterCtrl.groupIsShown(group.agroup)}" >
<li class="subheader" ng-click="rosterCtrl.showHideGroup(group.agroup)">
{{::group.agroup}}
<span class="info">{{group.agroupitems.length}}</span>
@ -39,9 +45,17 @@
</div>
<span
ng-if="::myjid.ajiditems.rosterview.avatar != false"
class="icon bubble status {{myjid.ajiditems.rosterview.presencetxt}}"
style="background-image: url({{::myjid.ajiditems.rosterview.avatar}})">
</span>
<span
ng-if="::myjid.ajiditems.rosterview.avatar== false"
class="icon bubble status {{myjid.ajiditems.rosterview.presencetxt}} color {{myjid.ajiditems.rosterview.color}}">
<i class="md md-person"></i>
</span>
<span>{{myjid.ajiditems.rosterview.name}}</span>
<p ng-if="myjid.ajiditems.status != ''" class="wrap">
<span>{{myjid.ajiditems.status}}</span>

13
app/widgets/Statistics/statistics.tpl

@ -6,9 +6,16 @@
{loop="$sessions"}
{$user = $c->getContact($value->username, $value->host)}
<li class="condensed">
<span class="icon bubble">
<img src="{$user->getPhoto('s')}">
</span>
{$url = $user->getPhoto('s')}
{if="$url"}
<span class="icon bubble">
<img src="{$url}">
</span>
{else}
<span class="icon bubble color {$user->jid|stringToColor}">
<i class="md md-person"></i>
</span>
{/if}
<span>{$user->getTrueName()} - {$value->username}@{$value->host} - {$value->domain}</span>
<p>
{if="isset($value->start)"}

9
themes/material/css/list.css

@ -21,6 +21,11 @@ ul li.oppose {
padding-right: 9rem;
}
ul li.inactive {
opacity: 0.6;
}
ul.simple > li {
padding-left: 2rem;
line-height: 6rem;
@ -107,6 +112,10 @@ ul li span {
white-space: nowrap;
}
ul li img {
max-width: 100%;
}
ul li.action {
padding-right: 7rem;
}

2
themes/material/css/style.css

@ -325,7 +325,7 @@ main > section > div {
}
main > section > div:not(:last-child) {
border-right: 1px solid gray;
border-right: 1px solid #DDDDDD;
}
main > section > div > * {

BIN
themes/material/img/favicon.ico

Loading…
Cancel
Save