]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/theme.php
Merge pull request #12429 from MrPetovan/bug/contactblock-icon
[friendica.git] / view / theme / smoothly / theme.php
1 <?php
2
3 /*
4  * Name: Smoothly
5  * Description: Theme based on Testbubble and optimized for Tablets.
6  * Version: Version 2013-05-08
7  * Author: Anne Walk, Devlon Duthied
8  * Author: Alex <https://red.pixelbits.de/channel/alex>
9  * Maintainer: Nomen Nominandum
10  * Screenshot: <a href="screenshot.png">Screenshot</a>
11  */
12
13 use Friendica\App;
14 use Friendica\Core\Renderer;
15 use Friendica\DI;
16
17 /*
18  * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
19  */
20
21 function smoothly_init(App $a) {
22         Renderer::setActiveTemplateEngine('smarty3');
23
24         $cssFile = null;
25         $ssl_state = false;
26         $baseurl = DI::baseUrl()->get($ssl_state);
27         DI::page()['htmlhead'] .= <<< EOT
28
29 <script>
30 function cmtBbOpen(id) {
31         $(".comment-edit-bb-" + id).show();
32 }
33 function cmtBbClose(comment, id) {
34         $(".comment-edit-bb-" + id).hide();
35 }
36 $(document).ready(function() {
37
38         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
39
40         $('.group-edit-icon').hover(
41                 function() {
42                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
43                 function() {
44                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
45         );
46
47         $('.sidebar-group-element').hover(
48                 function() {
49                         id = $(this).attr('id');
50                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
51
52                 function() {
53                         id = $(this).attr('id');
54                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
55         );
56
57
58         $('.savedsearchdrop').hover(
59                 function() {
60                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
61                 function() {
62                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
63         );
64
65         $('.savedsearchterm').hover(
66                 function() {
67                         id = $(this).attr('id');
68                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
69
70                 function() {
71                         id = $(this).attr('id');
72                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
73         );
74
75 });
76
77 </script>
78 EOT;
79
80         /** custom css **/
81         if (!is_null($cssFile)) {
82                 DI::page()['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
83         }
84
85         _js_in_foot();
86 }
87
88 if (! function_exists('_js_in_foot')) {
89         function _js_in_foot() {
90                 /** @purpose insert stuff in bottom of page
91                 */
92                 $ssl_state = false;
93                 $baseurl = DI::baseUrl()->get($ssl_state);
94                 $bottom['$baseurl'] = $baseurl;
95                 $tpl = Renderer::getMarkupTemplate('bottom.tpl');
96
97                 return DI::page()['bottom'] = Renderer::replaceMacros($tpl, $bottom);
98         }
99 }
100
101 /**
102  * @param int|null $uid
103  * @return null
104  * @see \Friendica\Core\Theme::getBackgroundColor()
105  * @TODO Implement this function
106  */
107 function smoothly_get_background_color(int $uid = null)
108 {
109         return null;
110 }
111
112 /**
113  * @param int|null $uid
114  * @return null
115  * @see \Friendica\Core\Theme::getThemeColor()
116  * @TODO Implement this function
117  */
118 function smoothly_get_theme_color(int $uid = null)
119 {
120         return null;
121 }