diff --git a/CHANGELOG b/CHANGELOG index 4ac5b68..7709043 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ **Changelog** 1.7.1 2016-? -- Update to movim 0.9 git2016-03-29 +- Update to movim 0.9 git2016-03-30 1.7 2016-03-17 - Update to movim 0.9 git2016-03-17 diff --git a/README.md b/README.md index 71e6d27..cf182e8 100644 --- a/README.md +++ b/README.md @@ -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. -Provided Movim version : 0.9 git2016-03-29 +Provided Movim version : 0.9 git2016-03-30 Please read CHANGELOG. diff --git a/sources/app/controllers/AboutController.php b/sources/app/controllers/AboutController.php index e80d928..d7ddc71 100644 --- a/sources/app/controllers/AboutController.php +++ b/sources/app/controllers/AboutController.php @@ -7,6 +7,6 @@ class AboutController extends Base { } function dispatch() { - $this->page->setTitle(__('title.about', APP_TITLE)); + $this->page->setTitle(__('page.about')); } } diff --git a/sources/app/controllers/AccountController.php b/sources/app/controllers/AccountController.php index 409a8f8..102f4e8 100644 --- a/sources/app/controllers/AccountController.php +++ b/sources/app/controllers/AccountController.php @@ -7,6 +7,6 @@ class AccountController extends Base { } function dispatch() { - $this->page->setTitle(__('title.account', APP_TITLE)); + $this->page->setTitle(__('page.account_creation')); } } diff --git a/sources/app/controllers/AccountnextController.php b/sources/app/controllers/AccountnextController.php index f4c7174..282ca69 100644 --- a/sources/app/controllers/AccountnextController.php +++ b/sources/app/controllers/AccountnextController.php @@ -7,6 +7,6 @@ class AccountnextController extends Base { } function dispatch() { - $this->page->setTitle(__('title.account', APP_TITLE)); + $this->page->setTitle(__('page.account_creation')); } } diff --git a/sources/app/controllers/AdminController.php b/sources/app/controllers/AdminController.php index 3dd1bf5..e704efb 100644 --- a/sources/app/controllers/AdminController.php +++ b/sources/app/controllers/AdminController.php @@ -10,7 +10,7 @@ class AdminController extends Base { session_start(); if(isset($_SESSION['admin']) && $_SESSION['admin'] == true) { - $this->page->setTitle(__('title.administration', APP_TITLE)); + $this->page->setTitle(__('page.administration')); } else { $this->name = 'adminlogin'; } diff --git a/sources/app/controllers/AdminloginController.php b/sources/app/controllers/AdminloginController.php index 4008bbf..dd145b2 100644 --- a/sources/app/controllers/AdminloginController.php +++ b/sources/app/controllers/AdminloginController.php @@ -10,7 +10,7 @@ class AdminloginController extends Base function dispatch() { - $this->page->setTitle(__('title.administration', APP_TITLE)); + $this->page->setTitle(__('page.administration')); $cd = new \Modl\ConfigDAO(); $config = $cd->get(); diff --git a/sources/app/controllers/LoginController.php b/sources/app/controllers/LoginController.php index fbef9d4..995fc3c 100644 --- a/sources/app/controllers/LoginController.php +++ b/sources/app/controllers/LoginController.php @@ -7,6 +7,9 @@ class LoginController extends Base { } function dispatch() { + $session = \Sessionx::start(); + requestURL('http://localhost:1560/unregister/', 2, ['sid' => $session->sessionid]); + $this->page->setTitle(__('page.login')); $user = new User(); diff --git a/sources/app/views/about.tpl b/sources/app/views/about.tpl index 61f570c..fb04255 100644 --- a/sources/app/views/about.tpl +++ b/sources/app/views/about.tpl @@ -1,7 +1,19 @@
- widget('Header'); ?>
+
+ +
widget('Tabs');?> widget('About');?> diff --git a/sources/app/views/account.tpl b/sources/app/views/account.tpl index 0b18c27..36271a8 100644 --- a/sources/app/views/account.tpl +++ b/sources/app/views/account.tpl @@ -1,6 +1,20 @@
- widget('Header'); ?>
- widget('Subscribe');?> +
+
+ +
+ widget('Subscribe');?> +
diff --git a/sources/app/views/accountnext.tpl b/sources/app/views/accountnext.tpl index f036e06..9c96eaf 100644 --- a/sources/app/views/accountnext.tpl +++ b/sources/app/views/accountnext.tpl @@ -1,6 +1,19 @@
- widget('Header'); ?>
- widget('AccountNext');?> +
+
+ +
+ widget('AccountNext');?> +
diff --git a/sources/app/views/admin.tpl b/sources/app/views/admin.tpl index 260534d..c1d5f5f 100644 --- a/sources/app/views/admin.tpl +++ b/sources/app/views/admin.tpl @@ -1,7 +1,19 @@
- widget('Header'); ?>
+
+ +
widget('Tabs');?> widget('AdminTest');?> widget('AdminMain');?> diff --git a/sources/app/views/adminlogin.tpl b/sources/app/views/adminlogin.tpl index 78c6e7f..34e515d 100644 --- a/sources/app/views/adminlogin.tpl +++ b/sources/app/views/adminlogin.tpl @@ -1,6 +1,20 @@
- widget('Header');?>
- widget('AdminLogin');?> +
+
+ +
+ widget('AdminLogin');?> +
diff --git a/sources/app/views/help.tpl b/sources/app/views/help.tpl index e17e4b7..084bb2d 100644 --- a/sources/app/views/help.tpl +++ b/sources/app/views/help.tpl @@ -9,7 +9,9 @@
  • - + + +

  • diff --git a/sources/app/widgets/Caps/caps.css b/sources/app/widgets/Caps/caps.css index 9a159d0..cf335dd 100644 --- a/sources/app/widgets/Caps/caps.css +++ b/sources/app/widgets/Caps/caps.css @@ -1,7 +1,7 @@ #caps_widget table { width: 100%; display: block; - + overflow: auto; font-size: 2rem; @@ -56,6 +56,6 @@ padding: 0 0.5rem; } -main > section > div > * { +main > section > div > #caps_widget { max-width: calc(100% - 4rem); } diff --git a/sources/app/widgets/Login/login.css b/sources/app/widgets/Login/login.css index 7dc0f5c..559e646 100644 --- a/sources/app/widgets/Login/login.css +++ b/sources/app/widgets/Login/login.css @@ -53,6 +53,14 @@ body main { padding: 1rem 2rem; } +#login_widget input#complete { + position: absolute; + top: 0; + border-bottom: none; + z-index: -1; + color: gray; +} + ul.admin { position: relative; text-align: center; diff --git a/sources/app/widgets/Login/login.js b/sources/app/widgets/Login/login.js index 32969b8..881f059 100644 --- a/sources/app/widgets/Login/login.js +++ b/sources/app/widgets/Login/login.js @@ -75,6 +75,7 @@ var Login = { Login.toForm(); document.querySelector('#login').value = jid; + document.querySelector('input#complete').value = jid; document.querySelector('#pass').value = ""; if(jid != '') { @@ -170,6 +171,25 @@ MovimWebsocket.register(function() }); movim_add_onload(function() { + // We had the autocomplete system + var login = document.querySelector('input#login'); + login.addEventListener('input', function() { + if(this.value.indexOf('@') == -1) { + // TODO allow another server here + document.querySelector('input#complete').value = this.value + '@movim.eu'; + } else { + document.querySelector('input#complete').value = this.value; + } + + if(this.value.length == 0) { + document.querySelector('input#complete').value = ''; + } + }); + + login.addEventListener('blur', function() { + this.value = document.querySelector('input#complete').value; + }); + /* Dump cache variables in localStorage */ for ( var i = 0, len = localStorage.length; i < len; ++i ) { var cache = localStorage.key(i); diff --git a/sources/app/widgets/Login/login.tpl b/sources/app/widgets/Login/login.tpl index 118c4fe..e1dbc8f 100644 --- a/sources/app/widgets/Login/login.tpl +++ b/sources/app/widgets/Login/login.tpl @@ -23,6 +23,7 @@
    +
    @@ -69,7 +70,7 @@
  • {$c->__('form.no_account')} - + {$c->__('form.create_one')}

    diff --git a/sources/src/Movim/Daemon/Api.php b/sources/src/Movim/Daemon/Api.php index 0b622aa..579e0f8 100644 --- a/sources/src/Movim/Daemon/Api.php +++ b/sources/src/Movim/Daemon/Api.php @@ -25,6 +25,8 @@ class Api { case 'exists': $response->write($api->sessionExists($request->getPost())); break; + case 'unregister': + $response->write($api->sessionUnregister($request->getPost())); case 'disconnect'; $response->write($api->sessionDisconnect($request->getPost())); break; @@ -49,6 +51,16 @@ class Api { && $sessions[$sid] == true); } + public function sessionUnregister($post) + { + $sid = $post['sid']; + + $session = $this->_core->getSession($sid); + if($session) { + $session->messageIn(json_encode(['func' => 'unregister'])); + } + } + public function sessionDisconnect($post) { $sid = $post['sid']; diff --git a/sources/src/Movim/Daemon/Core.php b/sources/src/Movim/Daemon/Core.php index 32fffcb..03109e7 100644 --- a/sources/src/Movim/Daemon/Core.php +++ b/sources/src/Movim/Daemon/Core.php @@ -92,7 +92,7 @@ class Core implements MessageComponentInterface { { $sid = $this->getSid($from); if($sid != null && isset($this->sessions[$sid])) { - $this->sessions[$sid]->messageIn($from, $msg); + $this->sessions[$sid]->messageIn($msg); } } @@ -152,6 +152,13 @@ class Core implements MessageComponentInterface { $this->sessions); } + public function getSession($sid) + { + if(isset($this->sessions[$sid])) { + return $this->sessions[$sid]; + } + } + private function getSid(ConnectionInterface $conn) { $cookies = $conn->WebSocket->request->getCookies(); diff --git a/sources/src/Movim/Daemon/Session.php b/sources/src/Movim/Daemon/Session.php index 00ff4c9..c84ac94 100644 --- a/sources/src/Movim/Daemon/Session.php +++ b/sources/src/Movim/Daemon/Session.php @@ -136,7 +136,7 @@ class Session { } } - public function messageIn(ConnectionInterface $from, $msg) + public function messageIn($msg) { $this->timestamp = time(); if(isset($this->process)) { diff --git a/sources/themes/material/css/style.css b/sources/themes/material/css/style.css index 22df6d4..9a8a2d0 100644 --- a/sources/themes/material/css/style.css +++ b/sources/themes/material/css/style.css @@ -181,7 +181,7 @@ body > nav li { /* Little hack for the navbar */ } } -@media screen and (min-width: 1024px) and (max-width: 1680px) { +@media screen and (min-width: 1024px) and (max-width: 1679px) { body > nav p { transition: opacity 0.5s cubic-bezier(.4,0,.2,1); opacity: 0;