]> git.mxchange.org Git - friendica.git/blob - view/theme/cleanzero/theme.php
c710473cbc24dbee61d1046f83798d6f277976cc
[friendica.git] / view / theme / cleanzero / theme.php
1 <?php
2 /*
3  * Name: cleanzero
4  * Description: Theme with clean design derived from the zero theme family. Including options to set color schemes, font sizes and resizing of images in posts 
5  * Version:
6  * Author: Christian Vogeley (https://christian-vogeley.de/profile/christian)
7  */
8 $a->theme_info = array(
9   'extends' => 'duepuntozero',
10 );
11 function cleanzero_init(&$a) {
12 $a->page['htmlhead'] .= <<< EOT
13 <script>
14 $(document).ready(function() {
15
16 $('.group-edit-icon').hover(
17         function() {
18                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
19         function() {
20                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
21         );
22
23 $('.sidebar-group-element').hover(
24         function() {
25                 id = $(this).attr('id');
26                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
27
28         function() {
29                 id = $(this).attr('id');
30                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
31         );
32
33
34 $('.savedsearchdrop').hover(
35         function() {
36                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
37         function() {
38                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
39         );
40
41 $('.savedsearchterm').hover(
42         function() {
43                 id = $(this).attr('id');
44                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
45
46         function() {
47                 id = $(this).attr('id');
48                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
49         );
50
51 });
52
53
54 </script>
55 EOT;
56 // get resize configuration
57
58 $resize=false;
59 $site_resize = get_config('cleanzero', 'resize' );
60 if(local_user()) $resize = get_pconfig(local_user(), 'cleanzero', 'resize' );
61
62 if ($resize===false) $resize=$site_resize;
63 if ($resize===false) $resize=0;
64
65 if (intval($resize) > 0) {
66 //load jquery.ae.image.resize.js
67 $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/cleanzero/js/jquery.ae.image.resize.js";
68 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
69 $a->page['htmlhead'] .= '
70 <script>
71
72  $(function() {
73         $(".wall-item-content-wrapper  img").aeImageResize({height: '.$resize.', width: '.$resize.'});
74   });
75 </script>';}
76 }