Browse Source

- Add a confirmation when you're quiting the Publish widget

- Fix the URL of a contact
- Fix some CSS
- Fix #1457492 -  Unable to close left menu on small screen 
- Display the status on the contacts bloc in Hello
- Add a class selector on the Group widget to prevent buggy refresh
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
c0e8e58db0
  1. 1
      app/assets/js/movim_tpl.js
  2. 2
      app/helpers/StringHelper.php
  3. 13
      app/widgets/Contact/Contact.php
  4. 8
      app/widgets/Contact/_contact.tpl
  5. 6
      app/widgets/Group/Group.php
  6. 4
      app/widgets/Group/group.js
  7. 9
      app/widgets/Hello/hello.tpl
  8. 17
      app/widgets/Navigation/navigation.tpl
  9. 10
      app/widgets/Publish/Publish.php
  10. 11
      app/widgets/Publish/_publish_back_confirm.tpl
  11. 9
      app/widgets/Publish/_publish_header.tpl
  12. 1
      app/widgets/Publish/locales.ini
  13. 33
      app/widgets/Publish/publish.js
  14. 2
      app/widgets/Roster/_roster_search.tpl
  15. 9
      themes/material/css/article.css
  16. 1
      themes/material/css/form.css
  17. 3
      themes/material/css/list.css

1
app/assets/js/movim_tpl.js

@ -74,6 +74,7 @@ var MovimTpl = {
//else document.querySelector(selector).innerHTML = '';
},
fill : function(selector, html) {
console.log(selector);
target = document.querySelector(selector);
if(target) {
target.innerHTML = html;

2
app/helpers/StringHelper.php

@ -233,7 +233,7 @@ function explodeJid($jid)
*/
function stringToUri($url) {
$url = utf8_decode($url);
$url = strtolower(strtr($url, utf8_decode('ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ()[]\'"~$&%*@ç!?;,:/\^¨€{}<>|+- '), 'aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn -- c --- e --'));
$url = strtolower(strtr($url, utf8_decode('ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ()[]\'"~$&%*@ç!?;,:/\^¨€{}<>|+- .'), 'aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn -- c --- e --_'));
$url = str_replace(' ', '', $url);
$url = str_replace('---', '-', $url);
$url = str_replace('--', '-', $url);

13
app/widgets/Contact/Contact.php

@ -197,7 +197,18 @@ class Contact extends WidgetBase
$cd = new \Modl\ContactDAO;
$c = $cd->get($jid, true);
if($c == null || $c->created == null || $c->isEmpty()) {
if($c == null
|| $c->created == null
|| $c->isEmpty()
|| strtotime($c->updated) < mktime( // We update the 3 days old vcards
0,
0,
0,
gmdate("m"),
gmdate("d")-3,
gmdate("Y")
)
) {
$c = new \Modl\Contact;
$c->jid = $jid;

8
app/widgets/Contact/_contact.tpl

@ -86,7 +86,13 @@
<li class="condensed block">
<span class="icon gray"><i class="md md-link"></i></span>
<span>{$c->__('general.website')}</span>
<p class="wrap"><a href="{$contact->url}" target="_blank">{$contact->url}</a></p>
<p class="wrap">
{if="filter_var($contact->url, FILTER_VALIDATE_URL)"}
<a href="{$contact->url}" target="_blank">{$contact->url}</a>
{else}
{$contact->url}
{/if}
</p>
</li>
{/if}

6
app/widgets/Group/Group.php

@ -181,7 +181,7 @@ class Group extends WidgetBase
Header::fill($header);
RPC::call('movim_fill', 'group_widget', $html);
RPC::call('MovimTpl.fill', '#group_widget.'.stringToUri($server.'_'.$node), $html);
RPC::call('Group.enableVideos');
}
@ -239,13 +239,13 @@ class Group extends WidgetBase
{
if(!$this->validateServerNode($server, $node)) return;
RPC::call('Group.addLoad', stringToUri($server.'_'.$node));
$r = new GetItemsId;
$r->setTo($server)
->setNode($node);
$r->request();
RPC::call('Group.addLoad');
}
function ajaxGetHistory($server, $node, $page)

4
app/widgets/Group/group.js

@ -1,6 +1,8 @@
var Group = {
addLoad: function() {
addLoad: function(id) {
document.querySelector('#group_widget').className = 'divided spinner';
movim_add_class('#group_widget', 'on');
movim_add_class('#group_widget', id);
},
clearLoad: function() {

9
app/widgets/Hello/hello.tpl

@ -2,7 +2,7 @@
<ul class="flex active middle">
<li class="subheader block large">Active contacts</li>
{loop="$top"}
<li tabindex="{$key+1}" class="block action {if="$value->getPlace()"}condensed{/if}"
<li tabindex="{$key+1}" class="block action {if="$value->status"}condensed{/if}"
onclick="Hello_ajaxChat('{$value->jid}')">
{$url = $value->getPhoto('s')}
{if="$url"}
@ -24,11 +24,14 @@
{/if}
<span>{$value->getTrueName()}</span>
<p class="wrap">{$value->getPlace()}</p>
<p class="wrap">{$value->status}</p>
</li>
{/loop}
<a class="block large" href="{$c->route('chat')}">
<li>
<li class="action">
<div class="action">
<i class="md md-chevron-right"></i>
</div>
<span class="icon">
<i class="md md-forum"></i>
</span>

17
app/widgets/Navigation/navigation.tpl

@ -1,13 +1,20 @@
<ul class="active">
<a class="classic" href="{$c->route('root')}">
<li class="action {if="$page == 'main'"}active{/if}">
<!--<div class="action on_mobile">
<i onclick="MovimTpl.toggleMenu()" class="md md-arrow-back"></i>
</div>-->
<a class="classic" href="#">
<li class="action on_mobile" onclick="MovimTpl.toggleMenu()">
<span class="icon bubble on_mobile"><i class="md md-menu"></i></span>
<span>Movim</span>
</li>
<li class="action on_desktop">
<span class="icon bubble"><i class="md md-cloud-queue"></i></span>
<span>Movim</span>
</li>
</a>
<a class="classic" href="{$c->route('root')}">
<li class="action {if="$page == 'main'"}active{/if}">
<span class="icon bubble"><i class="md md-home"></i></span>
<span>{$c->__('page.home')}</span>
</li>
</a>
<a class="classic {if="!$c->supported('pubsub')"}disabled{/if}" href="{$c->route('news')}">
<li {if="$page == 'news'"}class="active"{/if}>
<span class="icon"><i class="md md-view-list"></i></span>

10
app/widgets/Publish/Publish.php

@ -86,6 +86,16 @@ class Publish extends WidgetBase
RPC::call('Publish.setEmbed');
}
function ajaxFormFilled($server, $node)
{
$view = $this->tpl();
$view->assign('server', $server);
$view->assign('node', $node);
Dialog::fill($view->draw('_publish_back_confirm', true));
}
function ajaxPreview($form)
{
if($form->content->value != '') {

11
app/widgets/Publish/_publish_back_confirm.tpl

@ -0,0 +1,11 @@
<section>
<h4 class="gray">{$c->__('publish.form_filled')}</h4>
</section>
<div>
<a onclick="Dialog.clear()" class="button flat">
{$c->__('button.no')}
</a>
<a onclick="Publish.headerBack('{$server}', '{$node}', true); Dialog.clear();" class="button flat">
{$c->__('button.yes')}
</a>
</div>

9
app/widgets/Publish/_publish_header.tpl

@ -4,14 +4,7 @@
</div>
<div>
<div class="return active r3 condensed"
onclick="
if(typeof Post_ajaxClear === 'function') {
Post_ajaxClear();
Header_ajaxReset('news');
MovimTpl.hidePanel();
} else {
Group_ajaxGetItems('{$server}', '{$node}');
}">
onclick="Publish.headerBack('{$server}', '{$node}', false)">
<span id="back" class="icon" ><i class="md md-arrow-back"></i></span>
<h2>{$c->__('publish.new')}</h2>
<h4>

1
app/widgets/Publish/locales.ini

@ -19,3 +19,4 @@ publish.new = 'New post'
publish.title = 'Publish'
post.embed_tip = 'You can also use services like Imgur or Flickr to host your picture and paste the link here.'
publish.no_publication = 'You cannot publish a post on this Group'
publish.form_filled = 'Some fields have been filled in. Do you still want to go back and loose their content?'

33
app/widgets/Publish/publish.js

@ -21,6 +21,39 @@ var Publish = {
disableSend: function() {
movim_add_class('#button_send', 'disabled');
},
headerBack: function(server, node, ok) {
// We check if the form is filled
if(Publish.checkFilled() && ok == false) {
Publish_ajaxFormFilled('{$server}', '{$node}');
return;
}
// We are on the news page
if(typeof Post_ajaxClear === 'function') {
Post_ajaxClear();
Header_ajaxReset('news');
MovimTpl.hidePanel();
} else {
Group_ajaxGetItems(server, node);
}
},
checkFilled: function() {
var form = document.querySelector('form[name=post]');
var i = 0;
while(i < form.elements.length)
{
if(form.elements[i].type != 'hidden'
&& form.elements[i].value != form.elements[i].defaultValue) {
return true;
}
i++;
}
return false;
}
}

2
app/widgets/Roster/_roster_search.tpl

@ -12,7 +12,7 @@
{if="$jid != null"}
value="{$jid}"
{/if}
onkeyup="if(this.validity.valid == true) { {$search} }"
onkeyup="{$search}"
/>
<label for="searchjid">{$c->__('roster.add_contact_info1')}</label>
</div>

9
themes/material/css/article.css

@ -100,11 +100,15 @@ article section content q ul {
}
article section content q li {
flex: 1 50%;
flex: 1 25%;
list-style-type: none;
padding-left: 0;
}
article section content q li:first-child {
flex: 1 75%;
}
@media screen and (max-width: 1024px) {
article section content q li {
flex: 1 100%;
@ -112,8 +116,9 @@ article section content q li {
}
article section content q li img {
max-height: 40rem;
max-height: 10rem;
max-width: 100%;
float: right;
}
article ul li.pic img {

1
themes/material/css/form.css

@ -20,6 +20,7 @@ form > div > label {
overflow: hidden;
white-space: nowrap;
max-width: 100%;
left: 0; /* We force the left align */
}
form > div.icon {

3
themes/material/css/list.css

@ -148,7 +148,8 @@ ul li span.second {
}
ul li img {
max-width: 100%;
max-width: 100%;
height: auto;
}
ul li > p.more img:not(.emoji) {

Loading…
Cancel
Save