mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
update to upstream movim
This commit is contained in:
parent
1f01fc309c
commit
204da42083
21 changed files with 75 additions and 36 deletions
|
@ -1,7 +1,7 @@
|
||||||
**Changelog**
|
**Changelog**
|
||||||
|
|
||||||
1.7 2016-?
|
1.7 2016-?
|
||||||
- Update to movim 0.9 git2016-02-25
|
- Update to movim 0.9 git2016-03-06
|
||||||
- conf/nginx.conf : disable the Yunohost logo
|
- conf/nginx.conf : disable the Yunohost logo
|
||||||
|
|
||||||
1.6.1 2016-02-12
|
1.6.1 2016-02-12
|
||||||
|
|
|
@ -5,7 +5,7 @@ Movim is a decentralized social network, written in PHP and HTML5 and based on t
|
||||||
|
|
||||||
It is recommended to use a "valid" certificate to use Movim, auto-signed is sometimes problematic. You might want to take a look a StartSSL or Let's Encrypt.
|
It is recommended to use a "valid" certificate to use Movim, auto-signed is sometimes problematic. You might want to take a look a StartSSL or Let's Encrypt.
|
||||||
|
|
||||||
Provided Movim version : 0.9 git2016-02-25
|
Provided Movim version : 0.9 git2016-03-06
|
||||||
|
|
||||||
Please read CHANGELOG.
|
Please read CHANGELOG.
|
||||||
|
|
||||||
|
|
|
@ -112,11 +112,15 @@ var MovimTpl = {
|
||||||
return (selector.scrollHeight - Math.floor(selector.scrollTop) === selector.clientHeight);
|
return (selector.scrollHeight - Math.floor(selector.scrollTop) === selector.clientHeight);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scrollPanel : function() {
|
scrollPanel : function(time) {
|
||||||
var selector = document.querySelector('main section > div:first-child:nth-last-child(2) ~ div div');
|
var selector = document.querySelector('main section > div:first-child:nth-last-child(2) ~ div div');
|
||||||
|
|
||||||
|
if(typeof time == 'undefined') time = 0;
|
||||||
|
|
||||||
if(selector != null) {
|
if(selector != null) {
|
||||||
selector.scrollTop = selector.scrollHeight;
|
setTimeout(function() {
|
||||||
|
selector.scrollTop = selector.scrollHeight;
|
||||||
|
}, time);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scrollPanelTop : function() {
|
scrollPanelTop : function() {
|
||||||
|
|
|
@ -99,7 +99,7 @@ function prepareString($string, $large = false, $preview = false) {
|
||||||
$string = addUrls($string, $preview);
|
$string = addUrls($string, $preview);
|
||||||
|
|
||||||
// We remove all the style attributes
|
// We remove all the style attributes
|
||||||
$string = preg_replace_callback(
|
/*$string = preg_replace_callback(
|
||||||
'/(<[^>]+) style=".*?"/i', function($match) {
|
'/(<[^>]+) style=".*?"/i', function($match) {
|
||||||
return $match[1];
|
return $match[1];
|
||||||
}, $string
|
}, $string
|
||||||
|
@ -136,7 +136,7 @@ function prepareString($string, $large = false, $preview = false) {
|
||||||
'#<[/]?ss[^>]*>#is', function ($match) {
|
'#<[/]?ss[^>]*>#is', function ($match) {
|
||||||
return '';
|
return '';
|
||||||
}, ' ' . $string
|
}, ' ' . $string
|
||||||
);
|
);*/
|
||||||
|
|
||||||
// We add some smileys...
|
// We add some smileys...
|
||||||
$emoji = MovimEmoji::getInstance();
|
$emoji = MovimEmoji::getInstance();
|
||||||
|
|
|
@ -127,7 +127,6 @@ class Message extends Model {
|
||||||
$this->published = gmdate('Y-m-d H:i:s', strtotime($parent->delay->attributes()->stamp));
|
$this->published = gmdate('Y-m-d H:i:s', strtotime($parent->delay->attributes()->stamp));
|
||||||
else
|
else
|
||||||
$this->published = gmdate('Y-m-d H:i:s');
|
$this->published = gmdate('Y-m-d H:i:s');
|
||||||
$this->delivered = gmdate('Y-m-d H:i:s');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ class MessageDAO extends SQL {
|
||||||
html = :html,
|
html = :html,
|
||||||
published = :published,
|
published = :published,
|
||||||
delivered = :delivered,
|
delivered = :delivered,
|
||||||
edited = 1
|
edited = :edited
|
||||||
|
|
||||||
where session = :session
|
where session = :session
|
||||||
and id = :id
|
and id = :id
|
||||||
|
@ -25,6 +25,7 @@ class MessageDAO extends SQL {
|
||||||
'id' => $message->id,
|
'id' => $message->id,
|
||||||
'session' => $message->session,
|
'session' => $message->session,
|
||||||
'jidto' => $message->jidto,
|
'jidto' => $message->jidto,
|
||||||
|
'edited' => $message->edited,
|
||||||
'jidfrom' => $message->jidfrom,
|
'jidfrom' => $message->jidfrom,
|
||||||
'body' => $message->body,
|
'body' => $message->body,
|
||||||
'html' => $message->html,
|
'html' => $message->html,
|
||||||
|
@ -91,6 +92,25 @@ class MessageDAO extends SQL {
|
||||||
return $this->run('Message');
|
return $this->run('Message');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getId($id)
|
||||||
|
{
|
||||||
|
$this->_sql = '
|
||||||
|
select * from message
|
||||||
|
where session = :session
|
||||||
|
and id = :id
|
||||||
|
limit 1';
|
||||||
|
|
||||||
|
$this->prepare(
|
||||||
|
'Message',
|
||||||
|
array(
|
||||||
|
'session' => $this->_user,
|
||||||
|
'id' => $id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->run('Message', 'item');
|
||||||
|
}
|
||||||
|
|
||||||
function getLastItem($to)
|
function getLastItem($to)
|
||||||
{
|
{
|
||||||
$this->_sql = '
|
$this->_sql = '
|
||||||
|
|
|
@ -49,6 +49,6 @@
|
||||||
<?php $this->widget('Dialog');?>
|
<?php $this->widget('Dialog');?>
|
||||||
<?php $this->widget('Notification');?>
|
<?php $this->widget('Notification');?>
|
||||||
<?php $this->content();?>
|
<?php $this->content();?>
|
||||||
<script type="text/javascript">movim_onload();</script>
|
<script type="text/javascript">if(typeof movim_onload == 'function') { movim_onload(); }</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -47,10 +47,11 @@
|
||||||
<span class="primary icon gray">
|
<span class="primary icon gray">
|
||||||
<i class="zmdi zmdi-pages"></i>
|
<i class="zmdi zmdi-pages"></i>
|
||||||
</span>
|
</span>
|
||||||
<span class="control icon">
|
<span class="control icon active">
|
||||||
<a
|
<a
|
||||||
href="{$c->route('feed', array($server, $node))}"
|
href="{$c->route('feed', array($server, $node))}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
title="Atom"
|
||||||
>
|
>
|
||||||
<i class="zmdi zmdi-portable-wifi"></i>
|
<i class="zmdi zmdi-portable-wifi"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -25,6 +25,7 @@ class Chat extends WidgetBase
|
||||||
$this->addcss('chat.css');
|
$this->addcss('chat.css');
|
||||||
$this->registerEvent('carbons', 'onMessage');
|
$this->registerEvent('carbons', 'onMessage');
|
||||||
$this->registerEvent('message', 'onMessage');
|
$this->registerEvent('message', 'onMessage');
|
||||||
|
$this->registerEvent('receipt', 'onMessage');
|
||||||
$this->registerEvent('mamresult', 'onMessageHistory');
|
$this->registerEvent('mamresult', 'onMessageHistory');
|
||||||
$this->registerEvent('composing', 'onComposing');
|
$this->registerEvent('composing', 'onComposing');
|
||||||
$this->registerEvent('paused', 'onPaused');
|
$this->registerEvent('paused', 'onPaused');
|
||||||
|
@ -255,7 +256,6 @@ class Chat extends WidgetBase
|
||||||
} else {
|
} else {
|
||||||
$m->id = Uuid::uuid4();
|
$m->id = Uuid::uuid4();
|
||||||
$m->published = gmdate('Y-m-d H:i:s');
|
$m->published = gmdate('Y-m-d H:i:s');
|
||||||
$m->delivered = gmdate('Y-m-d H:i:s');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$session = \Sessionx::start();
|
$session = \Sessionx::start();
|
||||||
|
@ -571,7 +571,7 @@ class Chat extends WidgetBase
|
||||||
|
|
||||||
RPC::call('Chat.setBubbles', $left, $right, $room);
|
RPC::call('Chat.setBubbles', $left, $right, $room);
|
||||||
RPC::call('Chat.appendMessages', $messages);
|
RPC::call('Chat.appendMessages', $messages);
|
||||||
RPC::call('MovimTpl.scrollPanel');
|
RPC::call('MovimTpl.scrollPanel', 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareMessage(&$message)
|
function prepareMessage(&$message)
|
||||||
|
|
|
@ -111,9 +111,10 @@
|
||||||
state = 0;
|
state = 0;
|
||||||
Chat.sendMessage(this.dataset.jid, {if="$muc"}true{else}false{/if});
|
Chat.sendMessage(this.dataset.jid, {if="$muc"}true{else}false{/if});
|
||||||
return false;
|
return false;
|
||||||
} else if(event.keyCode == 38) {
|
} else if(event.keyCode == 38 && this.value == '') {
|
||||||
Chat_ajaxLast(this.dataset.jid);
|
Chat_ajaxLast(this.dataset.jid);
|
||||||
} else if(event.keyCode == 40) {
|
} else if(event.keyCode == 40
|
||||||
|
&& (this.value == '' || Chat.edit == true)) {
|
||||||
Chat.clearReplace();
|
Chat.clearReplace();
|
||||||
} else {
|
} else {
|
||||||
{if="!$muc"}
|
{if="!$muc"}
|
||||||
|
|
|
@ -158,6 +158,10 @@ var Chat = {
|
||||||
info.innerHTML = '<i class="zmdi zmdi-edit"></i> ' + info.innerHTML;
|
info.innerHTML = '<i class="zmdi zmdi-edit"></i> ' + info.innerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(message.delivered) {
|
||||||
|
info.innerHTML = '<i class="zmdi zmdi-check"></i> ' + info.innerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
if(prepend) {
|
if(prepend) {
|
||||||
Chat.date = message.published;
|
Chat.date = message.published;
|
||||||
var discussion = document.querySelector('#chat_widget div.contained');
|
var discussion = document.querySelector('#chat_widget div.contained');
|
||||||
|
@ -169,7 +173,8 @@ var Chat = {
|
||||||
var scrollDiff = discussion.scrollHeight - Chat.lastScroll;
|
var scrollDiff = discussion.scrollHeight - Chat.lastScroll;
|
||||||
discussion.scrollTop += scrollDiff;
|
discussion.scrollTop += scrollDiff;
|
||||||
Chat.lastScroll = discussion.scrollHeight;
|
Chat.lastScroll = discussion.scrollHeight;
|
||||||
} else if(message.edited) {
|
} else if(message.edited
|
||||||
|
|| message.delivered) {
|
||||||
var elem = document.getElementById(message.id);
|
var elem = document.getElementById(message.id);
|
||||||
if(elem)
|
if(elem)
|
||||||
elem.parentElement.replaceChild(bubble, elem);
|
elem.parentElement.replaceChild(bubble, elem);
|
||||||
|
@ -179,7 +184,7 @@ var Chat = {
|
||||||
movim_append(id, bubble.outerHTML);
|
movim_append(id, bubble.outerHTML);
|
||||||
}
|
}
|
||||||
|
|
||||||
bubble.querySelector('div.bubble').className = 'bubble';
|
//bubble.querySelector('div.bubble').className = 'bubble';
|
||||||
|
|
||||||
if(bubble.className.indexOf('oppose') > -1
|
if(bubble.className.indexOf('oppose') > -1
|
||||||
&& prepend == null) MovimTpl.scrollPanel();
|
&& prepend == null) MovimTpl.scrollPanel();
|
||||||
|
|
|
@ -88,7 +88,8 @@ class Chats extends WidgetBase
|
||||||
$g->setJid(echapJid($jid));
|
$g->setJid(echapJid($jid));
|
||||||
|
|
||||||
if(!empty($messages)) {
|
if(!empty($messages)) {
|
||||||
$g->setStart(strtotime($messages[0]->published));
|
// We add a little delay of 10sec to prevent some sync issues
|
||||||
|
$g->setStart(strtotime($messages[0]->published)+10);
|
||||||
}
|
}
|
||||||
|
|
||||||
$g->request();
|
$g->request();
|
||||||
|
|
|
@ -96,7 +96,10 @@ class Groups extends WidgetBase
|
||||||
|
|
||||||
function ajaxDisco($server)
|
function ajaxDisco($server)
|
||||||
{
|
{
|
||||||
if(!$this->validateServer($server)) return;
|
if(!$this->validateServer($server)) {
|
||||||
|
Notification::append(null, $this->__('groups.disco_error'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$r = new Items;
|
$r = new Items;
|
||||||
$r->setTo($server)->request();
|
$r->setTo($server)->request();
|
||||||
|
@ -191,9 +194,8 @@ class Groups extends WidgetBase
|
||||||
*/
|
*/
|
||||||
private function validateServer($server)
|
private function validateServer($server)
|
||||||
{
|
{
|
||||||
$validate_server = Validator::stringType()->noWhitespace()->length(6, 40);
|
$validate_server = Validator::noWhitespace()->alnum('.')->length(6, 40);
|
||||||
if(!$validate_server->validate($server)) return false;
|
return ($validate_server->validate($server));
|
||||||
else return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function display()
|
function display()
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p class="all">
|
<p class="all">
|
||||||
{if="$value->contentraw"}
|
{if="$value->contentraw"}
|
||||||
{$value->contentraw}
|
{$value->contentraw|prepareString}
|
||||||
{else}
|
{else}
|
||||||
{$value->title}
|
{$value->title}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<section class="scroll">
|
<section class="scroll">
|
||||||
<h3>{$c->__('chatrooms.users')}</h3>
|
<h3>{$c->__('chatrooms.users')}</h3>
|
||||||
<br />
|
<br />
|
||||||
<ul class="list middle">
|
<ul class="list">
|
||||||
{$presence = getPresencesTxt()}
|
{$presence = getPresencesTxt()}
|
||||||
{loop="$list"}
|
{loop="$list"}
|
||||||
<li class="{if="$value->last > 60"} inactive{/if}"
|
<li class="{if="$value->last > 60"} inactive{/if}"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<section>
|
<section>
|
||||||
<h3>{$c->__('roster.search')}</h3>
|
<h3>{$c->__('roster.search_pod')}</h3>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li>
|
<li>
|
||||||
<form name="add">
|
<form name="add">
|
||||||
|
|
|
@ -16,3 +16,4 @@ added = Contact added
|
||||||
updated = Contact updated
|
updated = Contact updated
|
||||||
deleted = Contact deleted
|
deleted = Contact deleted
|
||||||
search = Search in your contacts
|
search = Search in your contacts
|
||||||
|
search_pod = Search a contact
|
||||||
|
|
|
@ -63,7 +63,6 @@ class Stickers extends WidgetBase
|
||||||
$m->body = 'A Stickers has been sent using Movim';
|
$m->body = 'A Stickers has been sent using Movim';
|
||||||
|
|
||||||
$m->published = gmdate('Y-m-d H:i:s');
|
$m->published = gmdate('Y-m-d H:i:s');
|
||||||
$m->delivered = gmdate('Y-m-d H:i:s');
|
|
||||||
|
|
||||||
$session = \Sessionx::start();
|
$session = \Sessionx::start();
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ $stdin_behaviour = function ($data) use (&$conn, $loop, &$buffer, &$connector, &
|
||||||
if(!empty($xml) && $conn) {
|
if(!empty($xml) && $conn) {
|
||||||
//$timestamp = time();
|
//$timestamp = time();
|
||||||
$conn->write(trim($xml));
|
$conn->write(trim($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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -148,7 +148,7 @@ $xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$s
|
||||||
$restart = true;
|
$restart = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
|
#fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
|
||||||
#fwrite(STDERR, colorize(getenv('sid'), 'yellow')." widgets : ".\sizeToCleanSize(memory_get_usage())."\n");
|
#fwrite(STDERR, colorize(getenv('sid'), 'yellow')." widgets : ".\sizeToCleanSize(memory_get_usage())."\n");
|
||||||
|
|
||||||
\Moxl\API::clear();
|
\Moxl\API::clear();
|
||||||
|
@ -182,7 +182,7 @@ $xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$s
|
||||||
if(!empty($xml)) {
|
if(!empty($xml)) {
|
||||||
//$timestamp = time();
|
//$timestamp = time();
|
||||||
$conn->write(trim($xml));
|
$conn->write(trim($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");
|
||||||
}
|
}
|
||||||
|
|
||||||
\Moxl\API::clear();
|
\Moxl\API::clear();
|
||||||
|
|
|
@ -81,7 +81,7 @@ class BaseController {
|
||||||
} else {
|
} else {
|
||||||
$built = $content->build($this->name);
|
$built = $content->build($this->name);
|
||||||
$this->page->setContent($built);
|
$this->page->setContent($built);
|
||||||
echo $this->page->build('page');
|
echo $this->page->build('page', $this->public);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ class TplPageBuilder
|
||||||
/**
|
/**
|
||||||
* Actually generates the page from templates.
|
* Actually generates the page from templates.
|
||||||
*/
|
*/
|
||||||
function build($view)
|
function build($view, $public = false)
|
||||||
{
|
{
|
||||||
$this->_view = $view;
|
$this->_view = $view;
|
||||||
$template = $this->_view.'.tpl';
|
$template = $this->_view.'.tpl';
|
||||||
|
@ -78,8 +78,14 @@ class TplPageBuilder
|
||||||
|
|
||||||
require($this->viewsPath($template));
|
require($this->viewsPath($template));
|
||||||
$outp = ob_get_clean();
|
$outp = ob_get_clean();
|
||||||
|
|
||||||
|
$scripts = $this->printCss();
|
||||||
|
if(!$public) {
|
||||||
|
$scripts .= $this->printScripts();
|
||||||
|
}
|
||||||
|
|
||||||
$outp = str_replace('<%scripts%>',
|
$outp = str_replace('<%scripts%>',
|
||||||
$this->printCss() . $this->printScripts(),
|
$scripts,
|
||||||
$outp);
|
$outp);
|
||||||
|
|
||||||
return $outp;
|
return $outp;
|
||||||
|
|
Loading…
Add table
Reference in a new issue