From: <hn...@us...> - 2014-07-24 17:13:53
|
Author: hnategh Date: Thu Jul 24 19:13:46 2014 New Revision: 47901 URL: http://svn.stylite.de/viewvc/egroupware?rev=47901&view=rev Log: Add login.js to phpgwapi in order to make it available for all templates. Implement socialMedia for jdots and idots templates too Added: trunk/phpgwapi/js/login.js Modified: trunk/phpgwapi/inc/class.egw_framework.inc.php trunk/phpgwapi/templates/default/login.tpl trunk/phpgwapi/templates/idots/css/traditional.css Modified: trunk/phpgwapi/inc/class.egw_framework.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/inc/class.egw_framework.inc.php?rev=47901&r1=47900&r2=47901&view=diff ============================================================================== --- trunk/phpgwapi/inc/class.egw_framework.inc.php (original) +++ trunk/phpgwapi/inc/class.egw_framework.inc.php Thu Jul 24 19:13:46 2014 @@ -444,6 +444,9 @@ */ 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']); Added: trunk/phpgwapi/js/login.js URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/js/login.js?rev=47901&view=auto ============================================================================== --- trunk/phpgwapi/js/login.js (added) +++ trunk/phpgwapi/js/login.js Thu Jul 24 19:13:46 2014 @@ -1,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}); +// }); +// +//}); Modified: trunk/phpgwapi/templates/default/login.tpl URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/templates/default/login.tpl?rev=47901&r1=47900&r2=47901&view=diff ============================================================================== --- trunk/phpgwapi/templates/default/login.tpl (original) +++ trunk/phpgwapi/templates/default/login.tpl Thu Jul 24 19:13:46 2014 @@ -1,4 +1,4 @@ - +<script src="./phpgwapi/js/login.js" type="text/javascript"></script> <div id="loginMainDiv"> <div id="divAppIconBar" style="position:relative;"> <div id="divLogo"><a href="{logo_url}" target="_blank"><img src="{logo_file}" border="0" alt="{logo_title}" title="{logo_title}" /></a></div> @@ -61,6 +61,9 @@ </td> </tr> <!-- END registration --> + <tr> + <td id="socialBox"></td> + </tr> </table> </form> </div> Modified: trunk/phpgwapi/templates/idots/css/traditional.css URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/templates/idots/css/traditional.css?rev=47901&r1=47900&r2=47901&view=diff ============================================================================== --- trunk/phpgwapi/templates/idots/css/traditional.css (original) +++ trunk/phpgwapi/templates/idots/css/traditional.css Thu Jul 24 19:13:46 2014 @@ -468,7 +468,11 @@ position: relative; background-repeat: no-repeat; background-position: center 80px; - background-image: url(../images/login-background.jpg); + background-color: white; +} +#socialMedia { + left: 273px; + position: relative; } #loginScreenMessage { text-align: center; |