]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/theme.php
Merge remote-tracking branch 'upstream/2023.03-rc' into npf2
[friendica.git] / view / theme / smoothly / theme.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2023, the Friendica project
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  * Name: smoothly
21  *
22  * BEWARE: currently UNSUPPORTED
23  */
24
25 /*
26  * Name: Smoothly
27  * Description: Theme based on Testbubble and optimized for Tablets.
28  * Version: Version 2013-05-08
29  * Author: Anne Walk, Devlon Duthied
30  * Author: Alex <https://red.pixelbits.de/channel/alex>
31  * Maintainer: Nomen Nominandum
32  * Screenshot: <a href="screenshot.png">Screenshot</a>
33  */
34
35 use Friendica\App;
36 use Friendica\Core\Renderer;
37 use Friendica\DI;
38
39 /*
40  * This script can be included even when the app is in maintenance mode which requires us to avoid any config call
41  */
42
43 function smoothly_init(App $a) {
44         Renderer::setActiveTemplateEngine('smarty3');
45
46         $cssFile = null;
47         $ssl_state = false;
48         $baseurl = DI::baseUrl();
49         DI::page()['htmlhead'] .= <<< EOT
50
51 <script>
52 function cmtBbOpen(id) {
53         $(".comment-edit-bb-" + id).show();
54 }
55 function cmtBbClose(comment, id) {
56         $(".comment-edit-bb-" + id).hide();
57 }
58 $(document).ready(function() {
59
60         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
61
62         $('.group-edit-icon').hover(
63                 function() {
64                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
65                 function() {
66                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
67         );
68
69         $('.sidebar-group-element').hover(
70                 function() {
71                         id = $(this).attr('id');
72                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
73
74                 function() {
75                         id = $(this).attr('id');
76                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
77         );
78
79
80         $('.savedsearchdrop').hover(
81                 function() {
82                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
83                 function() {
84                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
85         );
86
87         $('.savedsearchterm').hover(
88                 function() {
89                         id = $(this).attr('id');
90                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
91
92                 function() {
93                         id = $(this).attr('id');
94                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
95         );
96
97 });
98
99 </script>
100 EOT;
101
102         /** custom css **/
103         if (!is_null($cssFile)) {
104                 DI::page()['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
105         }
106
107         _js_in_foot();
108 }
109
110 if (! function_exists('_js_in_foot')) {
111         function _js_in_foot() {
112                 /** @purpose insert stuff in bottom of page
113                 */
114                 $ssl_state = false;
115                 $baseurl = DI::baseUrl();
116                 $bottom['$baseurl'] = $baseurl;
117                 $tpl = Renderer::getMarkupTemplate('bottom.tpl');
118
119                 return DI::page()['bottom'] = Renderer::replaceMacros($tpl, $bottom);
120         }
121 }
122
123 /**
124  * @param int|null $uid
125  * @return null
126  * @see \Friendica\Core\Theme::getBackgroundColor()
127  * @TODO Implement this function
128  */
129 function smoothly_get_background_color(int $uid = null)
130 {
131         return null;
132 }
133
134 /**
135  * @param int|null $uid
136  * @return null
137  * @see \Friendica\Core\Theme::getThemeColor()
138  * @TODO Implement this function
139  */
140 function smoothly_get_theme_color(int $uid = null)
141 {
142         return null;
143 }