1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00

upgrade to movim 0.9 git2016-01-13

This commit is contained in:
Xavier ROOT 2016-01-13 12:08:24 +01:00
parent 836204e2a8
commit 7d90dbd2a9
20 changed files with 403 additions and 462 deletions

View file

@ -1,5 +1,8 @@
**Changelog** **Changelog**
1.6 ?
- Update to movim 0.9 git2016-01-13
1.5 2016-01-13 1.5 2016-01-13
- Update to movim 0.9 git2016-01-07 - Update to movim 0.9 git2016-01-07
- fix #16 (Installing movim crashes agendav) - fix #16 (Installing movim crashes agendav)

View file

@ -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 git2015-01-07 Provided Movim version : 0.9 git2016-01-13
Please read CHANGELOG. Please read CHANGELOG.

View file

@ -1,7 +1,29 @@
Movim Changelog Movim Changelog
================ ================
v0.8.1 (trunk) v0.9 (trunk)
---------------------------
* New User Interface for the whole project
* Removed BOSH connections and introduce pure XMPP TLS connections
* Full real-time + daemon
* New Blog engine and custom CSS support
* New post publication system + attachements supported (upload and embed links)
* Fully responsive design UI based on Material Design
* Huge code cleanup and refactoring
* Updated i18n system and new languages
* New eventing system
* New administration panel
* New dedicated chat page and emojis support
* New project icon and favicon
* New implementation for the Groups feature
* New Roster based on Angular
* Refactor the Contact management system and add a gallery on the profiles
* New universal-share bookmarklet
* CSS animations and mobile integration (FirefoxOS and Android)
* Internet Explorer 11 support
* PHP7 Support
v0.8.1
--------------------------- ---------------------------
* Add charts in the Statistics * Add charts in the Statistics
* Add a Caps support table * Add a Caps support table
@ -23,7 +45,7 @@ v0.8.0
* Refactor the whole Movim sourcecode + clean old code * Refactor the whole Movim sourcecode + clean old code
* Quite all the Movim widgets are now using a full MVC system * Quite all the Movim widgets are now using a full MVC system
* Rewrite the core session manager (Sessionx) * Rewrite the core session manager (Sessionx)
* Add a new localisation system + new translations * Add a new localisation system + new translations
* Move the Movim librairies and dependencies to Composer and convert Modl and Moxl to PSR-0 to simplify the loading and packaging of the libraries * Move the Movim librairies and dependencies to Composer and convert Modl and Moxl to PSR-0 to simplify the loading and packaging of the libraries
* Monolog is now the new log library for Movim * Monolog is now the new log library for Movim
@ -118,7 +140,7 @@ v0.6.0
### Datajar ### ### Datajar ###
* Support updating of db-schemas. * Support updating of db-schemas.
### Translations ### ### Translations ###
@ -139,7 +161,7 @@ v0.5.0
* Update dates (like “2 min ago”) automatically @edhelas * Update dates (like “2 min ago”) automatically @edhelas
* Clean and move UserConf in a single class @edhelas * Clean and move UserConf in a single class @edhelas
* New UI @edhelas * New UI @edhelas
### Core ### ### Core ###
* Integrate Datajar @etenil * Integrate Datajar @etenil
@ -184,7 +206,7 @@ v0.5.0
v0.4.0 v0.4.0
--------------------------- ---------------------------
* Multisession support * Multisession support
* Dynamically modify page title * Dynamically modify page title
* image.php to built pictures from the database + ask the browser to cache them * image.php to built pictures from the database + ask the browser to cache them
* Inscription on the Server (XMPP+Movim) * Inscription on the Server (XMPP+Movim)

View file

@ -1,9 +1,8 @@
Movim Installation Movim Installation
=================== ===================
* Movim deployment tutorial: https://github.com/edhelas/movim/wiki/Install-Movim * Movim deployment tutorial: https://github.com/movim/movim/wiki/Install-Movim
You can also follow the Jappix project documentation for a full stack deployment: You can also follow the Jappix project documentation for a full stack deployment:
* The XMPP server: https://github.com/jappix/jappix/wiki/XmppServer * The XMPP server: https://github.com/jappix/jappix/wiki/XmppServer
* The BOSH server: https://github.com/jappix/jappix/wiki/BoshServer

View file

@ -3,11 +3,11 @@ Movim - Kickass Social Network
Movim is a decentralized social network, written in PHP and HTML5 and based on the XMPP standard protocol. Movim is a decentralized social network, written in PHP and HTML5 and based on the XMPP standard protocol.
![movim logo](https://movim.eu/sites/default/files/large_0.png) ![movim logo](https://movim.eu/img/main_top.png)
Installation Installation
------------ ------------
Please refer to the installation instructions that are available on the GitHub Wiki : https://github.com/edhelas/movim/wiki . Please refer to the installation instructions that are available on the GitHub Wiki : https://github.com/movim/movim/wiki .
Translations Translations

View file

@ -1,8 +1,8 @@
/** /**
* @license MIT * @license MIT or GPL-2.0
* @fileOverview Favico animations * @fileOverview Favico animations
* @author Miroslav Magda, http://blog.ejci.net * @author Miroslav Magda, http://blog.ejci.net
* @version 0.3.7 * @version 0.3.10
*/ */
/** /**
@ -18,26 +18,28 @@
* position : 'down', * position : 'down',
* type : 'circle', * type : 'circle',
* animation : 'slide', * animation : 'slide',
* dataUrl: function(url){} * dataUrl: function(url){},
* win: top
* }); * });
*/ */
(function() { (function () {
var Favico = (function(opt) { var Favico = (function (opt) {
'use strict'; 'use strict';
opt = (opt) ? opt : {}; opt = (opt) ? opt : {};
var _def = { var _def = {
bgColor : '#d00', bgColor: '#d00',
textColor : '#fff', textColor: '#fff',
fontFamily : 'sans-serif', //Arial,Verdana,Times New Roman,serif,sans-serif,... fontFamily: 'sans-serif', //Arial,Verdana,Times New Roman,serif,sans-serif,...
fontStyle : 'bold', //normal,italic,oblique,bold,bolder,lighter,100,200,300,400,500,600,700,800,900 fontStyle: 'bold', //normal,italic,oblique,bold,bolder,lighter,100,200,300,400,500,600,700,800,900
type : 'circle', type: 'circle',
position : 'down', // down, up, left, leftup (upleft) position: 'down', // down, up, left, leftup (upleft)
animation : 'slide', animation: 'slide',
elementId : false, elementId: false,
dataUrl : false dataUrl: false,
win: window
}; };
var _opt, _orig, _h, _w, _canvas, _context, _img, _ready, _lastBadge, _running, _readyCb, _stop, _browser, _animTimeout, _drawTimeout; var _opt, _orig, _h, _w, _canvas, _context, _img, _ready, _lastBadge, _running, _readyCb, _stop, _browser, _animTimeout, _drawTimeout, _doc;
_browser = {}; _browser = {};
_browser.ff = typeof InstallTrigger != 'undefined'; _browser.ff = typeof InstallTrigger != 'undefined';
@ -48,13 +50,13 @@
_browser.supported = (_browser.chrome || _browser.ff || _browser.opera); _browser.supported = (_browser.chrome || _browser.ff || _browser.opera);
var _queue = []; var _queue = [];
_readyCb = function() { _readyCb = function () {
}; };
_ready = _stop = false; _ready = _stop = false;
/** /**
* Initialize favico * Initialize favico
*/ */
var init = function() { var init = function () {
//merge initial options //merge initial options
_opt = merge(_def, opt); _opt = merge(_def, opt);
_opt.bgColor = hexToRgb(_opt.bgColor); _opt.bgColor = hexToRgb(_opt.bgColor);
@ -62,31 +64,35 @@
_opt.position = _opt.position.toLowerCase(); _opt.position = _opt.position.toLowerCase();
_opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.animation; _opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.animation;
_doc = _opt.win.document;
var isUp = _opt.position.indexOf('up') > -1; var isUp = _opt.position.indexOf('up') > -1;
var isLeft = _opt.position.indexOf('left') > -1; var isLeft = _opt.position.indexOf('left') > -1;
//transform animation //transform the animations
if (isUp || isLeft) { if (isUp || isLeft) {
for (var i = 0; i < animation.types['' + _opt.animation].length; i++) { for (var a in animation.types) {
var step = animation.types['' + _opt.animation][i]; for (var i = 0; i < animation.types[a].length; i++) {
var step = animation.types[a][i];
if (isUp) { if (isUp) {
if (step.y < 0.6) { if (step.y < 0.6) {
step.y = step.y - 0.4; step.y = step.y - 0.4;
} else { } else {
step.y = step.y - 2 * step.y + (1 - step.w); step.y = step.y - 2 * step.y + (1 - step.w);
}
} }
}
if (isLeft) { if (isLeft) {
if (step.x < 0.6) { if (step.x < 0.6) {
step.x = step.x - 0.4; step.x = step.x - 0.4;
} else { } else {
step.x = step.x - 2 * step.x + (1 - step.h); step.x = step.x - 2 * step.x + (1 - step.h);
}
} }
}
animation.types['' + _opt.animation][i] = step; animation.types[a][i] = step;
}
} }
} }
_opt.type = (type['' + _opt.type]) ? _opt.type : _def.type; _opt.type = (type['' + _opt.type]) ? _opt.type : _def.type;
@ -97,9 +103,9 @@
//create temp image //create temp image
_img = document.createElement('img'); _img = document.createElement('img');
if (_orig.hasAttribute('href')) { if (_orig.hasAttribute('href')) {
_img.setAttribute('src', _orig.getAttribute('href')); _img.setAttribute('crossOrigin', 'anonymous');
//get width/height //get width/height
_img.onload = function() { _img.onload = function () {
_h = (_img.height > 0) ? _img.height : 32; _h = (_img.height > 0) ? _img.height : 32;
_w = (_img.width > 0) ? _img.width : 32; _w = (_img.width > 0) ? _img.width : 32;
_canvas.height = _h; _canvas.height = _h;
@ -107,16 +113,19 @@
_context = _canvas.getContext('2d'); _context = _canvas.getContext('2d');
icon.ready(); icon.ready();
}; };
_img.setAttribute('src', _orig.getAttribute('href'));
} else { } else {
_img.onload = function () {
_h = 32;
_w = 32;
_img.height = _h;
_img.width = _w;
_canvas.height = _h;
_canvas.width = _w;
_context = _canvas.getContext('2d');
icon.ready();
};
_img.setAttribute('src', ''); _img.setAttribute('src', '');
_h = 32;
_w = 32;
_img.height = _h;
_img.width = _w;
_canvas.height = _h;
_canvas.width = _w;
_context = _canvas.getContext('2d');
icon.ready();
} }
}; };
@ -127,7 +136,7 @@
/** /**
* Icon is ready (reset icon) and start animation (if ther is any) * Icon is ready (reset icon) and start animation (if ther is any)
*/ */
icon.ready = function() { icon.ready = function () {
_ready = true; _ready = true;
icon.reset(); icon.reset();
_readyCb(); _readyCb();
@ -135,7 +144,7 @@
/** /**
* Reset icon to default state * Reset icon to default state
*/ */
icon.reset = function() { icon.reset = function () {
//reset //reset
if (!_ready) { if (!_ready) {
return; return;
@ -155,11 +164,11 @@
/** /**
* Start animation * Start animation
*/ */
icon.start = function() { icon.start = function () {
if (!_ready || _running) { if (!_ready || _running) {
return; return;
} }
var finished = function() { var finished = function () {
_lastBadge = _queue[0]; _lastBadge = _queue[0];
_running = false; _running = false;
if (_queue.length > 0) { if (_queue.length > 0) {
@ -171,19 +180,19 @@
}; };
if (_queue.length > 0) { if (_queue.length > 0) {
_running = true; _running = true;
var run = function() { var run = function () {
// apply options for this animation // apply options for this animation
['type', 'animation', 'bgColor', 'textColor', 'fontFamily', 'fontStyle'].forEach(function(a) { ['type', 'animation', 'bgColor', 'textColor', 'fontFamily', 'fontStyle'].forEach(function (a) {
if ( a in _queue[0].options) { if (a in _queue[0].options) {
_opt[a] = _queue[0].options[a]; _opt[a] = _queue[0].options[a];
} }
}); });
animation.run(_queue[0].options, function() { animation.run(_queue[0].options, function () {
finished(); finished();
}, false); }, false);
}; };
if (_lastBadge) { if (_lastBadge) {
animation.run(_lastBadge.options, function() { animation.run(_lastBadge.options, function () {
run(); run();
}, true); }, true);
} else { } else {
@ -196,8 +205,8 @@
* Badge types * Badge types
*/ */
var type = {}; var type = {};
var options = function(opt) { var options = function (opt) {
opt.n = (( typeof opt.n) === 'number') ? Math.abs(opt.n | 0) : opt.n; opt.n = ((typeof opt.n) === 'number') ? Math.abs(opt.n | 0) : opt.n;
opt.x = _w * opt.x; opt.x = _w * opt.x;
opt.y = _h * opt.y; opt.y = _h * opt.y;
opt.w = _w * opt.w; opt.w = _w * opt.w;
@ -209,7 +218,7 @@
* Generate circle * Generate circle
* @param {Object} opt Badge options * @param {Object} opt Badge options
*/ */
type.circle = function(opt) { type.circle = function (opt) {
opt = options(opt); opt = options(opt);
var more = false; var more = false;
if (opt.len === 2) { if (opt.len === 2) {
@ -246,8 +255,8 @@
_context.stroke(); _context.stroke();
_context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')'; _context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')';
//_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15)); //_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
if (( typeof opt.n) === 'number' && opt.n > 999) { if ((typeof opt.n) === 'number' && opt.n > 999) {
_context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000) ) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2)); _context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000)) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2));
} else { } else {
_context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15)); _context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
} }
@ -257,7 +266,7 @@
* Generate rectangle * Generate rectangle
* @param {Object} opt Badge options * @param {Object} opt Badge options
*/ */
type.rectangle = function(opt) { type.rectangle = function (opt) {
opt = options(opt); opt = options(opt);
var more = false; var more = false;
if (opt.len === 2) { if (opt.len === 2) {
@ -278,8 +287,8 @@
_context.fillRect(opt.x, opt.y, opt.w, opt.h); _context.fillRect(opt.x, opt.y, opt.w, opt.h);
_context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')'; _context.fillStyle = 'rgba(' + _opt.textColor.r + ',' + _opt.textColor.g + ',' + _opt.textColor.b + ',' + opt.o + ')';
//_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15)); //_context.fillText((more) ? '9+' : opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
if (( typeof opt.n) === 'number' && opt.n > 999) { if ((typeof opt.n) === 'number' && opt.n > 999) {
_context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000) ) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2)); _context.fillText(((opt.n > 9999) ? 9 : Math.floor(opt.n / 1000)) + 'k+', Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.2));
} else { } else {
_context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15)); _context.fillText(opt.n, Math.floor(opt.x + opt.w / 2), Math.floor(opt.y + opt.h - opt.h * 0.15));
} }
@ -289,17 +298,17 @@
/** /**
* Set badge * Set badge
*/ */
var badge = function(number, opts) { var badge = function (number, opts) {
opts = (( typeof opts) === 'string' ? { opts = ((typeof opts) === 'string' ? {
animation : opts animation: opts
} : opts) || {}; } : opts) || {};
_readyCb = function() { _readyCb = function () {
try { try {
if ( typeof (number) === 'number' ? (number > 0) : (number !== '')) { if (typeof (number) === 'number' ? (number > 0) : (number !== '')) {
var q = { var q = {
type : 'badge', type: 'badge',
options : { options: {
n : number n: number
} }
}; };
if ('animation' in opts && animation.types['' + opts.animation]) { if ('animation' in opts && animation.types['' + opts.animation]) {
@ -308,26 +317,26 @@
if ('type' in opts && type['' + opts.type]) { if ('type' in opts && type['' + opts.type]) {
q.options.type = '' + opts.type; q.options.type = '' + opts.type;
} }
['bgColor', 'textColor'].forEach(function(o) { ['bgColor', 'textColor'].forEach(function (o) {
if ( o in opts) { if (o in opts) {
q.options[o] = hexToRgb(opts[o]); q.options[o] = hexToRgb(opts[o]);
} }
}); });
['fontStyle', 'fontFamily'].forEach(function(o) { ['fontStyle', 'fontFamily'].forEach(function (o) {
if ( o in opts) { if (o in opts) {
q.options[o] = opts[o]; q.options[o] = opts[o];
} }
}); });
_queue.push(q); _queue.push(q);
if (_queue.length > 100) { if (_queue.length > 100) {
throw 'Too many badges requests in queue.'; throw new Error('Too many badges requests in queue.');
} }
icon.start(); icon.start();
} else { } else {
icon.reset(); icon.reset();
} }
} catch(e) { } catch (e) {
throw 'Error setting badge. Message: ' + e.message; throw new Error('Error setting badge. Message: ' + e.message);
} }
}; };
if (_ready) { if (_ready) {
@ -338,21 +347,24 @@
/** /**
* Set image as icon * Set image as icon
*/ */
var image = function(imageElement) { var image = function (imageElement) {
_readyCb = function() { _readyCb = function () {
try { try {
var w = imageElement.width; var w = imageElement.width;
var h = imageElement.height; var h = imageElement.height;
var newImg = document.createElement('img'); var newImg = document.createElement('img');
var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h); var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
newImg.setAttribute('crossOrigin', 'anonymous');
newImg.onload=function(){
_context.clearRect(0, 0, _w, _h);
_context.drawImage(newImg, 0, 0, _w, _h);
link.setIcon(_canvas);
};
newImg.setAttribute('src', imageElement.getAttribute('src')); newImg.setAttribute('src', imageElement.getAttribute('src'));
newImg.height = (h / ratio); newImg.height = (h / ratio);
newImg.width = (w / ratio); newImg.width = (w / ratio);
_context.clearRect(0, 0, _w, _h); } catch (e) {
_context.drawImage(newImg, 0, 0, _w, _h); throw new Error('Error setting image. Message: ' + e.message);
link.setIcon(_canvas);
} catch(e) {
throw 'Error setting image. Message: ' + e.message;
} }
}; };
if (_ready) { if (_ready) {
@ -362,8 +374,8 @@
/** /**
* Set video as icon * Set video as icon
*/ */
var video = function(videoElement) { var video = function (videoElement) {
_readyCb = function() { _readyCb = function () {
try { try {
if (videoElement === 'stop') { if (videoElement === 'stop') {
_stop = true; _stop = true;
@ -374,12 +386,12 @@
//var w = videoElement.width; //var w = videoElement.width;
//var h = videoElement.height; //var h = videoElement.height;
//var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h); //var ratio = (w / _w < h / _h) ? (w / _w) : (h / _h);
videoElement.addEventListener('play', function() { videoElement.addEventListener('play', function () {
drawVideo(this); drawVideo(this);
}, false); }, false);
} catch(e) { } catch (e) {
throw 'Error setting video. Message: ' + e.message; throw new Error('Error setting video. Message: ' + e.message);
} }
}; };
if (_ready) { if (_ready) {
@ -389,18 +401,18 @@
/** /**
* Set video as icon * Set video as icon
*/ */
var webcam = function(action) { var webcam = function (action) {
//UR //UR
if (!window.URL || !window.URL.createObjectURL) { if (!window.URL || !window.URL.createObjectURL) {
window.URL = window.URL || {}; window.URL = window.URL || {};
window.URL.createObjectURL = function(obj) { window.URL.createObjectURL = function (obj) {
return obj; return obj;
}; };
} }
if (_browser.supported) { if (_browser.supported) {
var newVideo = false; var newVideo = false;
navigator.getUserMedia = navigator.getUserMedia || navigator.oGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia || navigator.webkitGetUserMedia; navigator.getUserMedia = navigator.getUserMedia || navigator.oGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia || navigator.webkitGetUserMedia;
_readyCb = function() { _readyCb = function () {
try { try {
if (action === 'stop') { if (action === 'stop') {
_stop = true; _stop = true;
@ -412,16 +424,16 @@
newVideo.width = _w; newVideo.width = _w;
newVideo.height = _h; newVideo.height = _h;
navigator.getUserMedia({ navigator.getUserMedia({
video : true, video: true,
audio : false audio: false
}, function(stream) { }, function (stream) {
newVideo.src = URL.createObjectURL(stream); newVideo.src = URL.createObjectURL(stream);
newVideo.play(); newVideo.play();
drawVideo(newVideo); drawVideo(newVideo);
}, function() { }, function () {
}); });
} catch(e) { } catch (e) {
throw 'Error setting webcam. Message: ' + e.message; throw new Error('Error setting webcam. Message: ' + e.message);
} }
}; };
if (_ready) { if (_ready) {
@ -442,10 +454,12 @@
try { try {
_context.clearRect(0, 0, _w, _h); _context.clearRect(0, 0, _w, _h);
_context.drawImage(video, 0, 0, _w, _h); _context.drawImage(video, 0, 0, _w, _h);
} catch(e) { } catch (e) {
} }
_drawTimeout = setTimeout(drawVideo, animation.duration, video); _drawTimeout = setTimeout(function () {
drawVideo(video);
}, animation.duration);
link.setIcon(_canvas); link.setIcon(_canvas);
} }
@ -453,11 +467,11 @@
/** /**
* Get icon from HEAD tag or create a new <link> element * Get icon from HEAD tag or create a new <link> element
*/ */
link.getIcon = function() { link.getIcon = function () {
var elm = false; var elm = false;
//get link element //get link element
var getLink = function() { var getLink = function () {
var link = document.getElementsByTagName('head')[0].getElementsByTagName('link'); var link = _doc.getElementsByTagName('head')[0].getElementsByTagName('link');
for (var l = link.length, i = (l - 1); i >= 0; i--) { for (var l = link.length, i = (l - 1); i >= 0; i--) {
if ((/(^|\s)icon(\s|$)/i).test(link[i].getAttribute('rel'))) { if ((/(^|\s)icon(\s|$)/i).test(link[i].getAttribute('rel'))) {
return link[i]; return link[i];
@ -469,45 +483,48 @@
elm = _opt.element; elm = _opt.element;
} else if (_opt.elementId) { } else if (_opt.elementId) {
//if img element identified by elementId //if img element identified by elementId
elm = document.getElementById(_opt.elementId); elm = _doc.getElementById(_opt.elementId);
elm.setAttribute('href', elm.getAttribute('src')); elm.setAttribute('href', elm.getAttribute('src'));
} else { } else {
//if link element //if link element
elm = getLink(); elm = getLink();
if (elm === false) { if (elm === false) {
elm = document.createElement('link'); elm = _doc.createElement('link');
elm.setAttribute('rel', 'icon'); elm.setAttribute('rel', 'icon');
document.getElementsByTagName('head')[0].appendChild(elm); _doc.getElementsByTagName('head')[0].appendChild(elm);
} }
} }
elm.setAttribute('type', 'image/png'); elm.setAttribute('type', 'image/png');
return elm; return elm;
}; };
link.setIcon = function(canvas) { link.setIcon = function (canvas) {
var url = canvas.toDataURL('image/png'); var url = canvas.toDataURL('image/png');
if (_opt.dataUrl) { if (_opt.dataUrl) {
//if using custom exporter //if using custom exporter
_opt.dataUrl(url); _opt.dataUrl(url);
} }
if (_opt.element) { if (_opt.element) {
_opt.element.setAttribute('href', url);
_opt.element.setAttribute('src', url); _opt.element.setAttribute('src', url);
} else if (_opt.elementId) { } else if (_opt.elementId) {
//if is attached to element (image) //if is attached to element (image)
document.getElementById(_opt.elementId).setAttribute('src', url); var elm = _doc.getElementById(_opt.elementId);
elm.setAttribute('href', url);
elm.setAttribute('src', url);
} else { } else {
//if is attached to fav icon //if is attached to fav icon
if (_browser.ff || _browser.opera) { if (_browser.ff || _browser.opera) {
//for FF we need to "recreate" element, atach to dom and remove old <link> //for FF we need to "recreate" element, atach to dom and remove old <link>
//var originalType = _orig.getAttribute('rel'); //var originalType = _orig.getAttribute('rel');
var old = _orig; var old = _orig;
_orig = document.createElement('link'); _orig = _doc.createElement('link');
//_orig.setAttribute('rel', originalType); //_orig.setAttribute('rel', originalType);
if (_browser.opera) { if (_browser.opera) {
_orig.setAttribute('rel', 'icon'); _orig.setAttribute('rel', 'icon');
} }
_orig.setAttribute('rel', 'icon'); _orig.setAttribute('rel', 'icon');
_orig.setAttribute('type', 'image/png'); _orig.setAttribute('type', 'image/png');
document.getElementsByTagName('head')[0].appendChild(_orig); _doc.getElementsByTagName('head')[0].appendChild(_orig);
_orig.setAttribute('href', url); _orig.setAttribute('href', url);
if (old.parentNode) { if (old.parentNode) {
old.parentNode.removeChild(old); old.parentNode.removeChild(old);
@ -522,14 +539,14 @@
//HEX to RGB convertor //HEX to RGB convertor
function hexToRgb(hex) { function hexToRgb(hex) {
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) { hex = hex.replace(shorthandRegex, function (m, r, g, b) {
return r + r + g + g + b + b; return r + r + g + g + b + b;
}); });
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? { return result ? {
r : parseInt(result[1], 16), r: parseInt(result[1], 16),
g : parseInt(result[2], 16), g: parseInt(result[2], 16),
b : parseInt(result[3], 16) b: parseInt(result[3], 16)
} : false; } : false;
} }
@ -553,7 +570,7 @@
* http://stackoverflow.com/questions/12536562/detect-whether-a-window-is-visible * http://stackoverflow.com/questions/12536562/detect-whether-a-window-is-visible
*/ */
function isPageHidden() { function isPageHidden() {
return document.hidden || document.msHidden || document.webkitHidden || document.mozHidden; return _doc.hidden || _doc.msHidden || _doc.webkitHidden || _doc.mozHidden;
} }
/** /**
@ -569,214 +586,214 @@
*/ */
animation.types = {}; animation.types = {};
animation.types.fade = [{ animation.types.fade = [{
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.0 o: 0.0
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.1 o: 0.1
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.2 o: 0.2
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.3 o: 0.3
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.4 o: 0.4
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.5 o: 0.5
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.6 o: 0.6
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.7 o: 0.7
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.8 o: 0.8
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 0.9 o: 0.9
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1.0 o: 1.0
}]; }];
animation.types.none = [{ animation.types.none = [{
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}]; }];
animation.types.pop = [{ animation.types.pop = [{
x : 1, x: 1,
y : 1, y: 1,
w : 0, w: 0,
h : 0, h: 0,
o : 1 o: 1
}, { }, {
x : 0.9, x: 0.9,
y : 0.9, y: 0.9,
w : 0.1, w: 0.1,
h : 0.1, h: 0.1,
o : 1 o: 1
}, { }, {
x : 0.8, x: 0.8,
y : 0.8, y: 0.8,
w : 0.2, w: 0.2,
h : 0.2, h: 0.2,
o : 1 o: 1
}, { }, {
x : 0.7, x: 0.7,
y : 0.7, y: 0.7,
w : 0.3, w: 0.3,
h : 0.3, h: 0.3,
o : 1 o: 1
}, { }, {
x : 0.6, x: 0.6,
y : 0.6, y: 0.6,
w : 0.4, w: 0.4,
h : 0.4, h: 0.4,
o : 1 o: 1
}, { }, {
x : 0.5, x: 0.5,
y : 0.5, y: 0.5,
w : 0.5, w: 0.5,
h : 0.5, h: 0.5,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}]; }];
animation.types.popFade = [{ animation.types.popFade = [{
x : 0.75, x: 0.75,
y : 0.75, y: 0.75,
w : 0, w: 0,
h : 0, h: 0,
o : 0 o: 0
}, { }, {
x : 0.65, x: 0.65,
y : 0.65, y: 0.65,
w : 0.1, w: 0.1,
h : 0.1, h: 0.1,
o : 0.2 o: 0.2
}, { }, {
x : 0.6, x: 0.6,
y : 0.6, y: 0.6,
w : 0.2, w: 0.2,
h : 0.2, h: 0.2,
o : 0.4 o: 0.4
}, { }, {
x : 0.55, x: 0.55,
y : 0.55, y: 0.55,
w : 0.3, w: 0.3,
h : 0.3, h: 0.3,
o : 0.6 o: 0.6
}, { }, {
x : 0.50, x: 0.50,
y : 0.50, y: 0.50,
w : 0.4, w: 0.4,
h : 0.4, h: 0.4,
o : 0.8 o: 0.8
}, { }, {
x : 0.45, x: 0.45,
y : 0.45, y: 0.45,
w : 0.5, w: 0.5,
h : 0.5, h: 0.5,
o : 0.9 o: 0.9
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}]; }];
animation.types.slide = [{ animation.types.slide = [{
x : 0.4, x: 0.4,
y : 1, y: 1,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.9, y: 0.9,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.9, y: 0.9,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.8, y: 0.8,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.7, y: 0.7,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.6, y: 0.6,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.5, y: 0.5,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}, { }, {
x : 0.4, x: 0.4,
y : 0.4, y: 0.4,
w : 0.6, w: 0.6,
h : 0.6, h: 0.6,
o : 1 o: 1
}]; }];
/** /**
* Run animation * Run animation
* @param {Object} opt Animation options * @param {Object} opt Animation options
@ -784,18 +801,18 @@
* @param {Object} revert Reverse order? true|false * @param {Object} revert Reverse order? true|false
* @param {Object} step Optional step number (frame bumber) * @param {Object} step Optional step number (frame bumber)
*/ */
animation.run = function(opt, cb, revert, step) { animation.run = function (opt, cb, revert, step) {
var animationType = animation.types[isPageHidden() ? 'none' : _opt.animation]; var animationType = animation.types[isPageHidden() ? 'none' : _opt.animation];
if (revert === true) { if (revert === true) {
step = ( typeof step !== 'undefined') ? step : animationType.length - 1; step = (typeof step !== 'undefined') ? step : animationType.length - 1;
} else { } else {
step = ( typeof step !== 'undefined') ? step : 0; step = (typeof step !== 'undefined') ? step : 0;
} }
cb = (cb) ? cb : function() { cb = (cb) ? cb : function () {
}; };
if ((step < animationType.length) && (step >= 0)) { if ((step < animationType.length) && (step >= 0)) {
type[_opt.type](merge(opt, animationType[step])); type[_opt.type](merge(opt, animationType[step]));
_animTimeout = setTimeout(function() { _animTimeout = setTimeout(function () {
if (revert) { if (revert) {
step = step - 1; step = step - 1;
} else { } else {
@ -813,25 +830,25 @@
//auto init //auto init
init(); init();
return { return {
badge : badge, badge: badge,
video : video, video: video,
image : image, image: image,
webcam : webcam, webcam: webcam,
reset : icon.reset, reset: icon.reset,
browser : { browser: {
supported : _browser.supported supported: _browser.supported
} }
}; };
}); });
// AMD / RequireJS // AMD / RequireJS
if ( typeof define !== 'undefined' && define.amd) { if (typeof define !== 'undefined' && define.amd) {
define([], function() { define([], function () {
return Favico; return Favico;
}); });
} }
// CommonJS // CommonJS
else if ( typeof module !== 'undefined' && module.exports) { else if (typeof module !== 'undefined' && module.exports) {
module.exports = Favico; module.exports = Favico;
} }
// included directly via <script> tag // included directly via <script> tag

View file

@ -56,9 +56,7 @@ var MovimWebsocket = {
}; };
this.connection.onmessage = function(e) { this.connection.onmessage = function(e) {
//console.log(e.data);
data = pako.ungzip(base64_decode(e.data), { to: 'string' }); data = pako.ungzip(base64_decode(e.data), { to: 'string' });
//data = e.data;
var obj = JSON.parse(data); var obj = JSON.parse(data);
@ -139,11 +137,9 @@ var MovimWebsocket = {
}, },
handle : function(funcalls) { handle : function(funcalls) {
//var funcalls = JSON.parse(json);
if(funcalls != null) { if(funcalls != null) {
for(h = 0; h < funcalls.length; h++) { for(h = 0; h < funcalls.length; h++) {
var funcall = funcalls[h]; var funcall = funcalls[h];
//console.log(funcall);
if(funcall.func != null && (typeof window[funcall.func] == 'function')) { if(funcall.func != null && (typeof window[funcall.func] == 'function')) {
try { try {
window[funcall.func].apply(null, funcall.params); window[funcall.func].apply(null, funcall.params);

View file

@ -20,7 +20,6 @@
<?php <?php
$this->addCss('style.css'); $this->addCss('style.css');
$this->addCss('header.css'); $this->addCss('header.css');
//$this->addCss('list.css');
$this->addCss('listn.css'); $this->addCss('listn.css');
$this->addCss('grid.css'); $this->addCss('grid.css');
$this->addCss('article.css'); $this->addCss('article.css');

View file

@ -14,14 +14,14 @@
<h1>{$c->__('chats.empty_title')}</h1> <h1>{$c->__('chats.empty_title')}</h1>
<h4>{$c->___('chats.empty', '<i class="zmdi zmdi-plus"></i>', '<a href="'.$c->route('contact').'"><i class="zmdi zmdi-accounts"></i> ', '</a>')}</h4> <h4>{$c->___('chats.empty', '<i class="zmdi zmdi-plus"></i>', '<a href="'.$c->route('contact').'"><i class="zmdi zmdi-accounts"></i> ', '</a>')}</h4>
</div> </div>
<a class="button action color" onclick="MovimTpl.toggleActionButton()"> <a class="button action color" onclick="MovimTpl.toggleActionButton()" title="{$c->__('button.chat')}">
<i class="zmdi zmdi-plus"></i> <i class="zmdi zmdi-plus"></i>
<ul class="actions"> <ul class="actions">
<li onclick="Chats_ajaxAdd()"> <li onclick="Chats_ajaxAdd()" title="{$c->__('chats.add')}">
<i class="zmdi zmdi-account-add"></i> <i class="zmdi zmdi-account-add"></i>
</li> </li>
<li onclick="Rooms_ajaxAdd()"> <li onclick="Rooms_ajaxAdd()" title="{$c->__('rooms.add')}">
<i class="zmdi zmdi-accounts-add"></i> <i class="zmdi zmdi-accounts-add"></i>
</li> </li>
</ul> </ul>

View file

@ -12,3 +12,4 @@ encrypted = Encrypted message
[button] [button]
chat = Chat chat = Chat
new = New conversation

View file

@ -39,6 +39,11 @@ class Contact extends WidgetBase
$html = $this->prepareContact($jid); $html = $this->prepareContact($jid);
$r = new GetItems;
$r->setTo($jid)
->setNode('urn:xmpp:microblog:0')
->request();
Header::fill($header); Header::fill($header);
RPC::call('movim_fill', 'contact_widget', $html); RPC::call('movim_fill', 'contact_widget', $html);
RPC::call('MovimTpl.showPanel'); RPC::call('MovimTpl.showPanel');

View file

@ -1,3 +1,3 @@
<a onclick="Publish_ajaxCreate('{$to}', 'urn:xmpp:microblog:0'); MovimTpl.showPanel();" class="button action color red"> <a onclick="Publish_ajaxCreate('{$to}', 'urn:xmpp:microblog:0'); MovimTpl.showPanel();" class="button action color red" title="{$c->__('menu.add_post')}">
<i class="zmdi zmdi-edit"></i> <i class="zmdi zmdi-edit"></i>
</a> </a>

View file

@ -11,9 +11,9 @@
<li> <li>
<ul class="tabs wide"> <ul class="tabs wide">
<li {if="$type == 'all'"}class="active"{/if}><a href="#" onclick="Menu_ajaxGetAll()">{$c->__('menu.all')}</a></li> <li {if="$type == 'all'"}class="active"{/if}><a href="#" onclick="Menu_ajaxGetAll()">{$c->__('menu.all')}</a></li>
<li {if="$type == 'news'"}class="active"{/if} ><a href="#" onclick="Menu_ajaxGetNews()"><i class="zmdi zmdi-pages"></i></a></li> <li {if="$type == 'news'"}class="active"{/if} ><a href="#" onclick="Menu_ajaxGetNews()" title="{$c->__('page.news')}"><i class="zmdi zmdi-pages"></i></a></li>
<li {if="$type == 'feed'"}class="active"{/if}><a href="#" onclick="Menu_ajaxGetFeed()"><i class="zmdi zmdi-accounts"></i></a></li> <li {if="$type == 'feed'"}class="active"{/if}><a href="#" onclick="Menu_ajaxGetFeed()" title="{$c->__('page.feed')}"><i class="zmdi zmdi-accounts"></i></a></li>
<li {if="$type == 'me'"}class="active"{/if}><a href="#" onclick="Menu_ajaxGetMe()"><i class="zmdi zmdi-portable-wifi"></i></a></li> <li {if="$type == 'me'"}class="active"{/if}><a href="#" onclick="Menu_ajaxGetMe()" title="{$c->__('menu.mine')}"><i class="zmdi zmdi-portable-wifi"></i></a></li>
</ul> </ul>
</li> </li>
</ul> </ul>

View file

@ -6,6 +6,8 @@ refresh = Refreshing all the streams
public = This post is public public = This post is public
all = All all = All
mine = My publications
groups = Groups groups = Groups
contacts = Contacts contacts = Contacts
refresh = Refresh all the streams refresh = Refresh all the streams
add_post = Add a post

View file

@ -41,6 +41,7 @@
</div> </div>
{/if} {/if}
{if="($public && $post->isPublic()) || !$public"}
<ul class="list thick"> <ul class="list thick">
<li> <li>
{if="$recycled"} {if="$recycled"}
@ -111,6 +112,7 @@
</li> </li>
</ul> </ul>
{/if}
</header> </header>
{if="!$external && !$public"} {if="!$external && !$public"}
@ -220,8 +222,8 @@
<div class="checkbox"> <div class="checkbox">
<input <input
type="checkbox" type="checkbox"
id="privacy" id="privacy_{$post->nodeid}"
name="privacy" name="privacy_{$post->nodeid}"
{if="$post->privacy"} {if="$post->privacy"}
checked checked
{/if} {/if}
@ -231,7 +233,7 @@
onclick="Post_ajaxTogglePrivacy('{$post->nodeid}')" onclick="Post_ajaxTogglePrivacy('{$post->nodeid}')"
{/if} {/if}
> >
<label for="privacy"></label> <label for="privacy_{$post->nodeid}"></label>
</div> </div>
</div> </div>
</form> </form>

View file

@ -48,8 +48,7 @@ class Presence extends WidgetBase
function onPostDisconnect($data) function onPostDisconnect($data)
{ {
RPC::call('movim_reload', RPC::call('movim_reload', Route::urlize('disconnect'));
BASE_URI."index.php?q=disconnect");
} }
function ajaxSet($form = false) function ajaxSet($form = false)

View file

@ -80,7 +80,7 @@
</div> </div>
</ul> </ul>
<br /> <br />
<a onclick="Roster_ajaxDisplaySearch()" class="button action color"> <a onclick="Roster_ajaxDisplaySearch()" class="button action color" title="{$c->__('roster.search')}">
<i class="zmdi zmdi-account-add"></i> <i class="zmdi zmdi-account-add"></i>
</a> </a>

View file

@ -15,7 +15,7 @@ accounts_nickname = Nickname
[privacy] [privacy]
privacy_title = Privacy Level privacy_title = Privacy Level
privacy_question = Is this profile public ? privacy_question = Is this profile public ?
privacy_info = "Please pay attention ! By making your profile public, all the information listed above will be available for all the Movim users and on the whole Internet." privacy_info = "Please pay attention ! By making your profile public, all the information listed bellow will be available for all the Movim users and on the whole Internet."
[save] [save]
submit = Submit submit = Submit

View file

@ -64,6 +64,8 @@ class Locale {
$po[$explode[0]] = $lang_list[$explode[0]]; $po[$explode[0]] = $lang_list[$explode[0]];
} }
} }
$po['en'] = 'English';
return $po; return $po;
} }

View file

@ -27,109 +27,3 @@ header.fixed + div {
margin-top: 7rem; margin-top: 7rem;
} }
/*
header.big {
background-size: cover, cover;
background-position: center center;
width: 100%;
max-width: 100%;
color: white;
position: relative;
margin-bottom: 2rem;
}
header.big p {
color: white;
}*/
/*
main > section > div > header,
main > section > div:first-child:nth-last-child(2) ~ div > header {
position: relative;
width: 100%;
max-width: 100%;
z-index: 1;
display: block;
overflow: hidden;
max-height: 50rem;
transition: max-height 0.3s cubic-bezier(.4,0,.2,1);
}
main > section > div > header.scroll,
main > section > div:first-child:nth-last-child(2) ~ div > header.scroll {
max-height: 7rem;
position: fixed;
top: 0;
transition: max-height 0.3s cubic-bezier(.4,0,.2,1);
}
main > section > div:first-child:nth-last-child(2) ~ div > header.scroll {
width: 65%;
}
main > section > div > header.scroll:not(.big) {
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
main > section > div:first-child:nth-last-child(2) > header.scroll {
width: 35%;
}
@media screen and (max-width: 1024px) {
main > section > div:first-child:nth-last-child(2) > header.scroll,
main > section > div:first-child:nth-last-child(2) ~ div > header.scroll {
width: 100%;
}
}
main > section > div > header > div > h2 {
display: inline-block;
margin-left: 1rem;
white-space: nowrap;
text-overflow: ellipsis;
max-width: calc(100% - 10rem);
opacity: 0;
transition: opacity 0.3s cubic-bezier(.4,0,.2,1);
transition-delay: 0.3s;
}
main > section > div > header.scroll > div > h2 {
opacity: 1;
}
main > section > div > header ul.tabs,
main > section > div > header form {
margin-top: 1rem;
width: calc(100% - 8rem);
box-sizing: border-box;
float: right;
border: 0;
}
main > section > div > header form {
padding: 0 1rem;
margin-top: 2rem;
}
main > section > div > header form > div:not(.clear):not(.control) {
min-height: 0;
}
main > section > div > header form > div > input:not([type=submit]) {
padding-top: 0rem;
}
header.big h2,
header.big p {
color: white;
}
main > section > div > header.scroll + * {
margin-top: 7rem;
}*/
/*
main > section > div > header + article {
margin-bottom: 2rem;
}
*/