Browse Source

- Remove the AccountError widget

- Fix the account registration
- Add a test on the anonymous room page when the room is not set
- Fix the search placeholder on Chrome
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
897cff4426
  1. 91
      app/widgets/AccountError/AccountError.php
  2. 1
      app/widgets/AccountError/accounterror.tpl
  3. 10
      app/widgets/AccountError/locales.ini
  4. 6
      app/widgets/AccountNext/AccountNext.php
  5. 8
      app/widgets/Rooms/_rooms.tpl
  6. 1
      app/widgets/Rooms/locales.ini
  7. 8
      linker.php
  8. 5
      themes/material/css/form.css

91
app/widgets/AccountError/AccountError.php

@ -1,91 +0,0 @@
<?php
/**
* @package Widgets
*
* @file AccountError.php
* This file is part of MOVIM.
*
* @brief The account creation widget error.
*
* @author Timothée Jaussoin <edhelas@gmail.com>
*
* @version 1.0
* @date 25 November 2011
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class AccountError extends WidgetBase {
function load()
{
}
function display()
{
$warning = '';
if(isset($_GET['err']))
switch ($_GET['err']) {
case 'datamissing':
$warning = '
<div class="message warning">
'.$this->__('error.data_missing').'
</div> ';
break;
case 'jiderror':
$warning = '
<div class="message warning">
'.$this->__('error.jid_error').'
</div> ';
break;
case 'passworddiff':
$warning = '
<div class="message info">
'.$this->__('error.password_diff').'
</div> ';
break;
case 'nameerr':
$warning = '
<div class="message warning">
'.$this->__('error.name_error').'
</div> ';
break;
case 'notacceptable':
$warning = '
<div class="message error">
'.$this->__('error.not_acceptable').'
</div> ';
break;
case 'userconflict':
$warning = '
<div class="message warning">
'.$this->__('error.user_conflict').'
</div> ';
break;
case 'xmppconnect':
$warning = '
<div class="message error">
'.$this->__('error.xmpp_connect').'
</div> ';
break;
case 'xmppcomm':
$warning = '
<div class="message error">
'.$this->__('error.xmpp_communicate').'
</div> ';
break;
case 'unknown':
$warning = '
<div class="message error">
'.$this->__('error.unknown').'
</div> ';
break;
}
$this->view->assign('warning', $warning);
}
}

1
app/widgets/AccountError/accounterror.tpl

@ -1 +0,0 @@
{$warning}

10
app/widgets/AccountError/locales.ini

@ -1,10 +0,0 @@
error.data_missing = 'Some data are missing !'
error.jid_error = 'Wrong ID'
error.password_diff = 'You entered different passwords'
error.name_error = 'Invalid name'
error.not_acceptable = 'Request not acceptable'
error.user_conflict = 'Username already taken'
error.xmpp_connect = 'Could not connect to the XMPP server'
error.xmpp_communicate = 'Could not communicate with the XMPP server'
error.unknown = 'Unknown error'

6
app/widgets/AccountNext/AccountNext.php

@ -91,6 +91,12 @@ class AccountNext extends WidgetBase {
function ajaxGetForm($host)
{
$domain = \Moxl\Utils::getDomain($host);
// We create a new session or clear the old one
$s = Sessionx::start();
$s->init(null, null, $host, $domain);
\Moxl\Stanza\Stream::init($host);
}

8
app/widgets/Rooms/_rooms.tpl

@ -29,7 +29,7 @@
{/if}
</ul>
{else}
{if="$c->getView() == 'room'"}
{if="$c->getView() == 'room' && $room != false"}
<div class="placeholder icon">
<h1>{$c->__('room.anonymous_title')}</h1>
<h4>{$c->__('room.anonymous_login', $room)}</h4>
@ -56,7 +56,11 @@
<script type="text/javascript">
Rooms.anonymous_room = '{$room}';
</script>
{elseif="$c->getView() == 'room'"}
<div class="placeholder icon">
<h1>{$c->__('room.anonymous_title')}</h1>
<h4>{$c->__('room.no_room')}</h4>
</div>
{else}
<div class="placeholder icon">
<h1>{$c->__('room.anonymous_title')}</h1>

1
app/widgets/Rooms/locales.ini

@ -22,6 +22,7 @@ bookmarks.updated = 'Bookmarks updated'
[anonymous]
room.anonymous_title = 'Public chatroom'
room.no_room = 'Please provide a room address'
room.anonymous_text1 = 'You are currently logued as an anonymous user.'
room.anonymous_text2 = 'You can join using your own account or create one on the login page by loging out using the cross in the top-right corner.'
room.anonymous_login = 'Login on %s'

8
linker.php

@ -45,7 +45,7 @@ $stdin_behaviour = function ($data) use (&$conn, $loop, &$buffer, &$connector, &
if($msg->func == 'message' && $msg->body != '') {
$msg = $msg->body;
} elseif($msg->func == 'unregister') {
$conn->close();
\Moxl\Stanza\Stream::end();
} elseif($msg->func == 'register') {
$cd = new \Modl\ConfigDAO();
$config = $cd->get();
@ -76,7 +76,7 @@ $stdin_behaviour = function ($data) use (&$conn, $loop, &$buffer, &$connector, &
if(!empty($xml) && $conn) {
$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 {
@ -111,7 +111,7 @@ $xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$s
$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");
\Moxl\API::clear();
@ -140,7 +140,7 @@ $xmpp_behaviour = function (React\Stream\Stream $stream) use (&$conn, $loop, &$s
if(!empty($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");
}
}

5
themes/material/css/form.css

@ -81,10 +81,7 @@ main > header form > div:not(.clear):not(.control) > .select select {
}
/* Placeholders to mimic FF */
::-webkit-input-placeholder { /* WebKit browsers */
color: #555;
opacity: 0.5;
}
::-webkit-input-placeholder, /* WebKit browsers */
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: #fff;
opacity: 0.5;

Loading…
Cancel
Save