Browse Source

- Clean a lot of old Javascript sourcecode

- Refactor the Javascript event handler
- The RPC parameters are passed directly to the JS (was an array before)
- Declare the Websocket connection URL correctly to use it on a remote client
- Fix a old issue during the user page refresh
- Fix the CSS of the Presence widget
- Fix some css in the Tabs widget
- Remove useless code in the Roster
- Clean some commented sourcecode
- Fix some CSS on the mobile version
- Chang the CSS of the notifications
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
b1883f42c5
  1. 16
      app/assets/js/movim_base.js
  2. 34
      app/assets/js/movim_tpl.js
  3. 5
      app/assets/js/movim_utils.js
  4. 20
      app/assets/js/movim_websocket.js
  5. 3
      app/views/page.tpl
  6. 6
      app/widgets/Chat/chat.js
  7. 2
      app/widgets/Login/Login.php
  8. 6
      app/widgets/Login/login.js
  9. 23
      app/widgets/Notification/Notification.php
  10. BIN
      app/widgets/Notification/img/error.png
  11. BIN
      app/widgets/Notification/img/info.png
  12. BIN
      app/widgets/Notification/img/success.png
  13. BIN
      app/widgets/Notification/img/warning.png
  14. 31
      app/widgets/Notification/notification.css
  15. 12
      app/widgets/Notification/notification.js
  16. 2
      app/widgets/Presence/Presence.php
  17. 7
      app/widgets/Presence/_presence_list.tpl
  18. 5
      app/widgets/Presence/locales.ini
  19. 101
      app/widgets/Presence/presence.css
  20. 4
      app/widgets/Presence/presence.js
  21. 1
      app/widgets/Profile/_profile_vcard.tpl
  22. 243
      app/widgets/Roster/roster.js
  23. 1
      app/widgets/System/System.php
  24. 1
      app/widgets/System/system.tpl
  25. 2
      app/widgets/Tabs/tabs.css
  26. 8
      app/widgets/Wall/Wall.php
  27. 2
      app/widgets/Wall/wall.tpl
  28. 3
      bootstrap.php
  29. 2
      system/template/TplPageBuilder.php
  30. 1
      themes/movim/css/mobile.css

16
app/assets/js/movim_base.js

@ -52,15 +52,11 @@ function movim_title_inc() {
movim_show_cpt();
}
function movim_posts_unread(params) {
posts_cpt = params[0];
function movim_posts_unread(cpt) {
posts_cpt = cpt;
movim_show_cpt();
}
function movim_desktop_notification_arr(arr) {
movim_desktop_notification(arr[0], arr[1], arr[2]);
}
function movim_desktop_notification(title, body, image) {
var notification = new Notification(title, { icon: image, body: body });
@ -70,8 +66,8 @@ function movim_desktop_notification(title, body, image) {
/**
* TODO : remove this function
*/
function movim_change_class(params) {
var node = document.getElementById(params[0]);
function movim_change_class(element, classname, title) {
var node = document.getElementById(element);
var tmp;
for (var i = 0; i < node.childNodes.length; i++) {
tmp=node.childNodes[i];
@ -82,8 +78,8 @@ function movim_change_class(params) {
}
}
privacy.className = params[1];
privacy.title = params[2];
privacy.className = classname;
privacy.title = title;
}
/**

34
app/assets/js/movim_tpl.js

@ -11,45 +11,33 @@
*/
// movim_append(div, text)
function movim_append(params)
function movim_append(id, html)
{
if(params.length < 2) {
return;
}
target = document.getElementById(params[0]);
target = document.getElementById(id);
if(target) {
target.insertAdjacentHTML('beforeend', params[1]);
target.insertAdjacentHTML('beforeend', html);
}
}
// movim_prepend(div, text)
function movim_prepend(params)
function movim_prepend(id, html)
{
if(params.length < 2) {
return;
}
target = document.getElementById(params[0]);
target = document.getElementById(id);
if(target) {
target.insertAdjacentHTML('afterbegin', params[1]);
target.insertAdjacentHTML('afterbegin', html);
}
}
// movim_fill(div, text)
function movim_fill(params)
function movim_fill(id, html)
{
if(params.length < 2) {
return;
}
target = document.getElementById(params[0]);
target = document.getElementById(id);
if(target) {
target.innerHTML = params[1];
target.innerHTML = html;
}
}
// movim_delete(div)
function movim_delete(params)
function movim_delete(id)
{
target = document.getElementById(params[0]);
target = document.getElementById(id);
if(target)
target.parentNode.removeChild(target);
}

5
app/assets/js/movim_utils.js

@ -201,10 +201,7 @@ function movim_button_reset(element) {
* @param string the selector of the element
*/
function movim_toggle_display(element) {
if (element.constructor === Array)
var node = movim_get_node(element[0]);
else
var node = movim_get_node(element);
var node = movim_get_node(element);
if(node != null) {
if(node.style.display == 'block')

20
app/assets/js/movim_websocket.js

@ -25,7 +25,7 @@ function MovimWebsocket() {
}
MovimWebsocket.prototype.init = function() {
this.connection = new WebSocket('ws://localhost:8080');
this.connection = new WebSocket('ws://' + BASE_HOST + ':8080');
this.connection.onopen = function(e) {
console.log("Connection established!");
@ -41,7 +41,7 @@ MovimWebsocket.prototype.init = function() {
};
this.connection.onmessage = function(e) {
console.log(e.data);
//console.log(e.data);
var obj = JSON.parse(e.data);
if(obj.id) {
@ -78,23 +78,17 @@ MovimWebsocket.prototype.send = function(widget, func, params) {
};
MovimWebsocket.prototype.handle = function(json) {
var funcalls = eval(json);
var funcalls = JSON.parse(json);
if(funcalls != null) {
for(h = 0; h < funcalls.length; h++) {
var funcall = funcalls[h];
if(funcall.func != null && eval("typeof " + funcall.func) == "function") {
var funcs = funcall.func.split('.');
if(funcall.func != null && (typeof window[funcall.func] == 'function')) {
try {
if(funcs.length == 1)
window[funcs[0]](funcall.params);
else if(funcs.length == 2)
window[funcs[0]][funcs[1]](funcall.params);
}
catch(err) {
console.log("Error caught: " + err.toString() + " - " +funcall.func);
window[funcall.func].apply(null, funcall.params);
} catch(err) {
console.log("Error caught: " + err.toString() + " - " + funcall.func + ":" + JSON.stringify(funcall.params));
}
}
}

3
app/views/page.tpl

@ -29,6 +29,8 @@
$this->addCss('css/template.css');
$this->widget('System');
$this->scripts();
$this->addCss('css/mobile.css');
@ -58,7 +60,6 @@
</style>';
}
?>
<?php $this->widget('System');?>
</head>
<body>
<noscript>

6
app/widgets/Chat/chat.js

@ -1,6 +1,6 @@
function scrollAllTalks() {
var mes = document.querySelectorAll('.messages');
for (var i=0; i<mes.length; i++){
for (var i = 0; i<mes.length; i++){
// We add 200px to prevent smiley loading
mes.item(i).scrollTop = mes.item(i).scrollHeight + 200;
}
@ -66,10 +66,10 @@ function showPaused(jid) {
paused.style.display = 'block';
}
function notify(params) {
function notify(title, body, image) {
if(document_focus == false) {
movim_title_inc();
movim_desktop_notification(params[0], params[1], params[2]);
movim_desktop_notification(title, body, image);
}
}

2
app/widgets/Login/Login.php

@ -131,7 +131,7 @@ class Login extends WidgetBase
}
RPC::call('websocket.unregister');
RPC::call('movim_desktop_notification_arr', $title, $warning);
RPC::call('movim_desktop_notification', $title, $warning);
}
private function displayWarning($warning, $htmlonly = false)

6
app/widgets/Login/login.js

@ -70,10 +70,10 @@ function backToChoose() {
/**
* @brief Post login requests
*/
function postLogin(params) {
rememberSession(params[0]);
function postLogin(jid, url) {
rememberSession(jid);
localStorage.postStart = 1;
movim_reload(params[1]);
movim_reload(url);
}
movim_add_onload(function()

23
app/widgets/Notification/Notification.php

@ -31,9 +31,28 @@ class Notification extends WidgetCommon
static function appendNotification($message, $type = 'info')
{
$id = md5($message.$type);
switch($type) {
case 'success':
$icon = 'fa-check-circle';
break;
case 'info':
$icon = 'fa-info-circle';
break;
case 'warning':
$icon = 'fa-warning';
break;
case 'error':
$icon = 'fa-times-circle';
break;
default:
$icon = 'fa-info-circle';
break;
}
$html = '
<div class="notif notificationAnim '.$type.'" id="'.$id.'">'.
$message.'
<div class="notif notificationAnim '.$type.'" id="'.$id.'">
<i class="fa '.$icon.'"></i> '.$message.'
</div>';
RPC::call('removeDiff', 'notification_widget', $html, $id);

BIN
app/widgets/Notification/img/error.png

Before

Width: 16  |  Height: 16  |  Size: 246 B

BIN
app/widgets/Notification/img/info.png

Before

Width: 16  |  Height: 16  |  Size: 237 B

BIN
app/widgets/Notification/img/success.png

Before

Width: 16  |  Height: 16  |  Size: 319 B

BIN
app/widgets/Notification/img/warning.png

Before

Width: 16  |  Height: 16  |  Size: 138 B

31
app/widgets/Notification/notification.css

@ -10,44 +10,23 @@
-moz-box-sizing: border-box;
padding: 1em;
pointer-events: none;
}
#notification_widget .notif {
background-color: rgba(0, 0, 0, 0.8);
background-color: #323232;
border-radius: 0.1em;
margin-top: 1em;
width: 100%;
color: white;
padding: 0.7em;
padding-left: 3em;
padding: 0.7em 1.3em;
opacity: 1;
pointer-events: none;
line-height: 1.5em;
background-repeat: no-repeat;
background-position: 1em center;
background-image: url(img/success.png);
}
#notification_widget .notif.error {
background-image: url(img/error.png);
}
#notification_widget .notif.warning {
background-image: url(img/warning.png);
}
#notification_widget .notif.info {
background-image: url(img/info.png);
}
#notification_widget .notif:hover {
opacity: 0.4;
}
.notificationAnim {
opacity: 0;
visibility: hidden;

12
app/widgets/Notification/notification.js

@ -1,19 +1,15 @@
function removeDiff(params) {
if(params.length < 2) {
return;
}
function removeDiff(id, html, id2) {
var wrapper= document.createElement('div');
wrapper.innerHTML = params[1];
wrapper.innerHTML = html;
var nodes = wrapper.childNodes;
target = document.getElementById(params[0]);
target = document.getElementById(id);
if(target) {
for(i = 0; i < nodes.length; i++) {
var n = nodes[i];
// The notification is already here ?
if(document.getElementById(params[2]) == null) {
if(document.getElementById(id2) == null) {
target.appendChild(n);
setTimeout(function() {
n.parentNode.removeChild(n);

2
app/widgets/Presence/Presence.php

@ -40,7 +40,9 @@ class Presence extends WidgetBase
{
$html = $this->preparePresence();
RPC::call('movim_fill', 'presence_widget', $html);
Notification::appendNotification($this->__('status.updated'), 'success');
RPC::call('setPresenceActions');
RPC::call('movim_toggle_class', '#presence_widget', 'unfolded');
RPC::commit();
}

7
app/widgets/Presence/_presence_list.tpl

@ -5,8 +5,8 @@
<img class="avatar" src="{$contact->getPhoto('s')}"/>
<span class="bubble"></span>
<span class="arrow"><i class="fa fa-caret-down"></i></span>
<span class="name">{$contact->getTrueName()}</span>
<span class="status">{$p->status}</span>
<span class="name on_desktop">{$contact->getTrueName()}</span><br />
<span class="status on_desktop">{$p->status}</span>
</div>
{else}
<div
@ -14,7 +14,8 @@
class="{$txts[1]}">
<img class="avatar" src="{$contact->getPhoto('s')}"/>
<span class="arrow"><i class="fa fa-caret-down"></i></span>
<span class="name">{$contact->getTrueName()}</span>
<span class="name on_desktop">{$contact->getTrueName()}</span><br />
<span class="status on_desktop"></span>
</div>
{/if}

5
app/widgets/Presence/locales.ini

@ -1,2 +1,3 @@
disconnect = 'Disconnect'
status.here = 'Your status here !'
disconnect = 'Disconnect'
status.here = 'Your status here !'
status.updated = 'Status updated'

101
app/widgets/Presence/presence.css

@ -1,11 +1,11 @@
#presence_widget {
color: white;
font-weight: bold;
width: 15rem;
max-width: 15rem;
position: fixed;
top: 0;
right: 0;
z-index: 5;
z-index: 4;
padding: 0.3em;
box-sizing: border-box;
}
#presence_widget img.avatar {
@ -17,8 +17,8 @@
}
#presence_widget span.bubble {
left: 1.7em;
top: 1.7em;
left: 1.4em;
top: 1.4em;
width: 0.9em;
height: 0.9em;
box-shadow: 0 0 2px rgba(0, 0, 0, 1);
@ -32,10 +32,30 @@
#presence_widget .dnd span.bubble { background-color: #D92727; }
#presence_widget .xa span.bubble { background-color: #442178; }
#presence_widget #tab {
color: white;
height: 2.5em;
padding: 0.2em;
width: 14.4rem;
box-sizing: border-box;
float: right;
position: relative;
}
#presence_widget #tab:hover {
cursor: pointer;
border-radius: 0.05em;
background-color: rgba(255, 255, 255, 0.2);
}
#presence_widget span.arrow {
float: right;
padding-right: 0.5em;
line-height: 2em;
}
#presence_widget span.name,
#presence_widget span.status {
line-height: 1em;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
}
@ -46,52 +66,51 @@
color: #DDD;
}
#presence_widget span.arrow {
float: right;
padding: 0.5em;
#presence_widget #list {
width: 15rem;
background-color: white;
display: none;
z-index: 6;
}
#presence_widget textarea.status {
margin: 0.5em 0;
padding: 0.5em;
box-sizing: border-box;
border: 0;
width: 100%;
border-bottom: 1px solid #D4D4D4;
height: 2.7em;
resize: none;
#presence_widget #list .tab {
padding: 0.2em;
}
#presence_widget #tab {
padding: 0.3em;
margin: 0.2em;
#presence_widget #list .tab span.name {
line-height: 2em;
}
#presence_widget #tab:hover {
#presence_widget #list .tab:hover {
cursor: pointer;
border-radius: 0.05em;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 0.1em;
}
#presence_widget #list {
background-color: white;
padding: 0.3em;
margin: 0.2em;
color: #333;
position: relative;
#presence_widget.unfolded #tab {
display: none;
top: -2.8em;
border-radius: 0.05em;
}
#presence_widget.unfolded #list {
display: block;
border-radius: 0.1em;
box-shadow: 0 0 0.3em rgba(0, 0, 0, 0.4);
}
#presence_widget #list .tab:hover {
cursor: pointer;
#presence_widget textarea.status {
margin: 0.5em 0;
padding: 0.5em;
box-sizing: border-box;
border: 0;
width: 100%;
border-bottom: 1px solid #D4D4D4;
height: 2.7em;
resize: none;
}
#presence_widget #list span.name {
line-height: 2em;
padding-bottom: 0.5em;
@media screen and (max-width: 1024px) {
#presence_widget #tab {
width: auto;
}
}
#presence_widget #list a {
@ -101,7 +120,6 @@
font-weight: normal;
line-height: 2.8em;
padding: 0 1em;
margin: -0.3em;
}
#presence_widget #list a:hover {
@ -120,6 +138,7 @@
box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
display: inline-block;
float: right;
margin-top: 1.1em;
margin-top: 1em;
position: initial;
}

4
app/widgets/Presence/presence.js

@ -17,11 +17,11 @@ function setPresenceActions() {
};
document.querySelector('#presence_widget #tab').onclick = function(event) {
movim_toggle_display('#presence_widget #list');
movim_toggle_class('#presence_widget', 'unfolded');
};
document.querySelector('#presence_widget #list .tab').onclick = function(event) {
movim_toggle_display('#presence_widget #list');
movim_toggle_class('#presence_widget', 'unfolded');
};
}

1
app/widgets/Profile/_profile_vcard.tpl

@ -7,6 +7,7 @@
<a href="{$c->route('profile')}">
<i class="fa fa-pencil"></i>
</a>
<div class="clear"></div>
</div>
{else}
<div class="not_yet">

243
app/widgets/Roster/roster.js

@ -44,14 +44,6 @@ function showHideRoster(hide) {
document.querySelector('#roster').className = '';
}
function incomingPresence(val) {
target = document.getElementById('roster'+val[0]);
if(target) {
target.className = val[1];
}
sortRoster();
}
movim_add_onload(function()
{
var search = document.querySelector('#rostersearch');
@ -91,240 +83,9 @@ movim_add_onload(function()
}
};
});
/*ROSTER SEARCH*/
/*
function focusContact(){
rosterlist = document.querySelector('#rosterlist');
focused = rosterlist.querySelector('.focused');
if( focused != null){
focused.className = focused.className.split(' ')[0];
}
allLi = "";
//offline are shown
if(rosterlist.className!=""){
allLi = rosterlist.querySelectorAll("li");
}
//offline are hidden
else{
allLi = rosterlist.querySelectorAll("li:not(.offline)");
}
for(j=0; j<allLi.length; j++){
if(rosterInArray(allLi[j], allLi)){
allLi[j].className += " focused";
break;
}
}
document.querySelector('#right').scrollTop = 0;
}
function rosterNextGroup(cgp){
if(cgp.nextSibling.nextSibling != null){
cgp = cgp.nextSibling.nextSibling;
while(cgp.className == "" && cgp != gp[gp.length-1]){ //do not read hidden groups
rosterNextGroup(cgp);
}
newLis = cgp.querySelectorAll("li");
if(rosterInArray(newLis[0], newLis)){
returned = newLis[0];
decalage += cgp.querySelector("h1").offsetHeight;
}
else{
rosterNext(newLis[0]);
}
}
}
function rosterNext(currFocus){
currGp = currFocus.parentNode;
viable = false;
gp = rosterlist.querySelectorAll("div:not(.chat)");
returned = "";
//Define contact end limit
visible = "";
currentGroupVisible = "";
if(rosterlist.className != ""){//offline are shown
visible = rosterlist.querySelectorAll("li");
currentGroupVisible = currGp.querySelectorAll("li");
}
else{
visible = rosterlist.querySelectorAll("li:not(.offline)");
currentGroupVisible = currGp.querySelectorAll("li:not(.offline)");
}
last = visible[visible.length - 1];
if(currFocus != last){
//search for currFocused or end of group
if(currFocus.nextSibling != null){ //not end of group
currFocus = currFocus.nextSibling;
//search for the next viable contact or find the end of the group
while(!rosterInArray(currFocus, currentGroupVisible) && currFocus.nextSibling != null){
currFocus = currFocus.nextSibling;
}
if(rosterInArray(currFocus, currentGroupVisible)){
viable = true;
returned = currFocus;
}
}
if(currFocus.nextSibling == null && !viable){//Change groupe
if(currGp != gp[gp.length-1]){
rosterNextGroup(currGp);
}
}
}else{returned = currFocus;}
giveFocusTo(returned);
}
function rosterPreviousGroup(cgp){
if(cgp.previousSibling.previousSibling != null){
cgp = cgp.previousSibling.previousSibling;
while(cgp.className == "" && cgp != gp[0]){ //do not read hidden groups
rosterPreviousGroup(cgp);
}
newLis = cgp.querySelectorAll("li");
newLi = newLis[newLis.length - 1];
if(rosterInArray(newLi, newLis)){
returned = newLi;
decalage -= cgp.querySelector("h1").offsetHeight;
}
else{
rosterPrevious(newLi);
}
}
}
function rosterPrevious(currFocus){
currGp = currFocus.parentNode;
viable = false;
gp = rosterlist.querySelectorAll("div:not([class='chat on'])");
returned = "";
visible = "";
currentGroupVisible = "";
//Define contact begin limit
if(rosterlist.class != ""){//offline are shown
visible = rosterlist.querySelectorAll("li");
currentGroupVisible = currGp.querySelectorAll("li");
}
else{
visible = rosterlist.querySelectorAll("li:not(.offline)");
currentGroupVisible = currGp.querySelectorAll("li:not(.offline)");
}
first = visible[0];
if(currFocus != first){
//currentFocus' previous can be null, not li or viable
if(currFocus.previousSibling != null){ //not beginning of group
currFocus = currFocus.previousSibling;
//search for the next viable contact or find the end of the group
while(!rosterInArray(currFocus, currentGroupVisible) && currFocus.previousSibling != null){
currFocus = currFocus.previousSibling;
}
if(rosterInArray(currFocus, currentGroupVisible)){
viable = true;
returned = currFocus;
}
}
if(currFocus.previousSibling == null && !viable){//Change groupe
if(currGp != gp[0]){
rosterPreviousGroup(currGp);
}
}
}else{returned = currFocus;}
giveFocusTo(returned);
}
function giveFocusTo(newFocused){
focused = document.querySelector('#rosterlist').querySelector('.focused');
if(newFocused != focused){
focused.className = focused.className.split(' ')[0];
newFocused.className += " focused";
}
}
function rosterSearch(e){
rosterlist = document.querySelector('#rosterlist');
parents = rosterlist.querySelectorAll('li');
names = rosterlist.getElementsByTagName('a');
request = document.querySelector('#request').value;
focused = rosterlist.querySelector('.focused');
//if key pressed is backspace, alphanumeric or delete
if(e.keyCode==8 || (e.keyCode>47 && e.keyCode<91) || (e.keyCode>95 && e.keyCode<106) || e.keyCode==46){
focusflag = false;
for(i = 0; i < parents.length; i++){
// hide all contacts that doesn't match
if(names[i].innerHTML.toLowerCase().lastIndexOf(request.toLowerCase()) == -1){
parents[i].style.display = "none";
}
else{
parents[i].style.display = "list-item";
// replace the old focused by the new one if there is an old one
if(!focusflag){
giveFocusTo(parents[i]);
focusflag = true;
}
}
}
document.querySelector('#right').scrollTop = 0;
}
else{
if(e.keyCode == 13){ //key pressed is enter; launch chat
eval(focused.getElementsByTagName("div")[0].getAttribute("onclick"));
}
if(e.keyCode>36 && e.keyCode<41){ //key pressed is an arrow
//begin reading from focused
decalage = focused.offsetHeight;
//if(0 == (decalage = focused.offsetHeight))
//decalage = focused.nextSibling.offsetHeight;
switch(e.keyCode){
//previous
case e.keyCode = 38:
rosterPrevious(rosterlist.querySelector(".focused"));
//top of the focused must be under navbar
diff = focused.offsetTop - rosterlist.offsetTop - document.querySelector('#right').scrollTop - focused.offsetHeight;
if(decalage < focused.offsetHeight)
diff -= rosterlist.querySelector("h1").offsetHeight;
if(diff < 0){
document.querySelector('#right').scrollTop += diff;
}
break;
//next
case e.keyCode = 40:
rosterNext(rosterlist.querySelector(".focused"));
//bottom of the focused must be over the rostermenu, scrollTop is the only variable
diff = focused.offsetTop + rosterlist.offsetTop + focused.offsetHeight - document.querySelector('#rostermenu').offsetTop - document.querySelector('#right').scrollTop;
if(decalage > focused.offsetHeight)
diff += rosterlist.querySelector("h1").offsetHeight;
if(diff > 0){
document.querySelector('#right').scrollTop += diff;
}
break;
}
}
}
}
function rosterInArray(thing, array){
for(i=0; i<array.length; i++){
if(array[i] == thing){
visibility = thing.currentStyle ? thing.currentStyle.display :
getComputedStyle(thing, null).display;
if(visibility != "none"){
return true;
}
}
}
return false;
}
*/
function rosterToggleGroup(h){
group = document.getElementById(h[0]);
function rosterToggleGroup(id){
group = document.getElementById(id);
if(group.className == '')
group.className = 'groupshown';

1
app/widgets/System/System.php

@ -20,6 +20,7 @@ class System extends WidgetBase {
function display()
{
$this->view->assign('base_uri', BASE_URI);
$this->view->assign('base_host', BASE_HOST);
$this->view->assign('error_uri', substr_replace(Route::urlize('disconnect', 'err'), '', -3));
$r = new Route;

1
app/widgets/System/system.tpl

@ -1,5 +1,6 @@
<script type="text/javascript">
var BASE_URI = '{$base_uri}';
var BASE_HOST = '{$base_host}';
var ERROR_URI = '{$error_uri}';
var PAGE_KEY_URI = '{$page_key_uri}';
var FAIL_SAFE = '{$fail_safe}';

2
app/widgets/Tabs/tabs.css

@ -25,7 +25,7 @@
padding: 0em 1em;
width:100%;
text-decoration: none;
color: #888;
color: #555;
}
#navtabs li:hover a {

8
app/widgets/Wall/Wall.php

@ -54,14 +54,16 @@ class Wall extends WidgetCommon
function onStream($payload) {
$html = $this->prepareFeed(-1, $payload['from']);
RPC::call('movim_fill', stringToUri($payload['from'].$payload['node']), $html);
if($html != '') {
RPC::call('movim_fill', stringToUri($payload['from'].$payload['node']), $html);
}
RPC::commit();
}
function prepareFeed($start, $from = false) {
if(!$from && isset($_GET['f'])) {
$from = $_GET['f'];
} else {
} elseif(!$from) {
return '';
}

2
app/widgets/Wall/wall.tpl

@ -1,7 +1,7 @@
<div class="tabelem" id="wall" title="{$c->__('feed.title')}" >
<div class="protect orange" title="{function="getFlagTitle("orange")"}"></div>
<div id="{function="stringToUri($_GET['f'].'urn:xmpp:microblog:0')"}">
{$wall = $c->prepareFeed(-1)}
{$wall = $c->prepareFeed(-1, $_GET['f'])}
{if="$wall"}
{$wall}
{else}

3
bootstrap.php

@ -99,6 +99,7 @@ class Bootstrap {
define('APP_TITLE', 'Movim');
define('APP_NAME', 'movim');
define('APP_VERSION', $this->getVersion());
define('BASE_HOST', $_SERVER['HTTP_HOST']);
define('BASE_URI', $this->getBaseUri());
define('CACHE_URI', $this->getBaseUri() . 'cache/');
@ -148,8 +149,6 @@ class Bootstrap {
$uri .= str_replace('//', '/', $_SERVER['HTTP_HOST'] . $path);
}
$uri = str_replace('jajax.php', '', $uri);
if(getenv('baseuri') != null
&& filter_var(getenv('baseuri'), FILTER_VALIDATE_URL)
&& sizeof(getenv('baseuri')) < 32) {

2
system/template/TplPageBuilder.php

@ -140,7 +140,7 @@ class TplPageBuilder
echo ' on_desktop ';
}
echo '"';
echo "><span class=\"mobile\">".$link['label'] . "</span></a></li>\n";
echo "><span class=\"on_desktop\">".$link['label'] . "</span></a></li>\n";
} else {
echo $link['html'];
}

1
themes/movim/css/mobile.css

@ -46,6 +46,7 @@ h1 {
#right {
width: 100%;
top: 0;
position: relative;
}

Loading…
Cancel
Save