diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 0b441209a8..67772c395d 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -444,6 +444,9 @@ abstract class egw_framework */ function login_screen($extra_vars) { + //allow to include JSONP file with social media urls from egroupware.org + self::csp_script_src_attrs('https://www.egroupware.org'); + //error_log(__METHOD__."() server[template_dir]=".array2string($GLOBALS['egw_info']['server']['template_dir']).", this->template=$this->template, this->template_dir=$this->template_dir, get_class(this)=".get_class($this)); $tmpl = new Template($GLOBALS['egw_info']['server']['template_dir']); diff --git a/phpgwapi/js/login.js b/phpgwapi/js/login.js new file mode 100644 index 0000000000..7d8cc4d366 --- /dev/null +++ b/phpgwapi/js/login.js @@ -0,0 +1,54 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + + +egw_LAB.wait(function() { + $j.ajax('https://www.egroupware.org/social.js', { + dataType: "jsonp", + jsonp: false, + jsonpCallback: "do_social", + cache: true + }).done(function(_data) + { + $j(document).ready(function() { + var social = $j(document.createElement('div')) + .attr({ + id: "socialMedia", + class: "socialMedia" + }) + .appendTo($j('#socialBox')); + + for(var i=0; i < _data.length; ++i) + { + var data = _data[i]; + var url = (data.lang ? data.lang[$j('meta[name="language"]').attr('content')] : null) || data.url; + $j(document.createElement('a')).attr({ + href: url, + target: '_blank' + }) + .appendTo(social) + .append($j(document.createElement('img')) + .attr('src', data.svg)); + } + }); + }); +}); + +// $j('img.bgfade').hide(); +//// var dg_H = $j(window).height(); +//// var dg_W = $j(window).width(); +//// $j('#wrap').css({'height':dg_H,'width':dg_W}); +// +// function anim() { +// $j("#wrap img.bgfade").first().appendTo('#wrap').fadeOut(3500); +// $j("#wrap img").first().fadeIn(3500); +// setTimeout(anim, 7000); +// } +//anim(); +//$j(window).resize(function(){window.location.href=window.location.href}); +// }); +// +//}); diff --git a/phpgwapi/templates/default/login.tpl b/phpgwapi/templates/default/login.tpl index ea008b86d0..038a446323 100644 --- a/phpgwapi/templates/default/login.tpl +++ b/phpgwapi/templates/default/login.tpl @@ -1,4 +1,4 @@ - +