]> git.mxchange.org Git - friendica.git/blob - view/theme/smoothly/theme.php
Replace deprecated $a->page with DI::page()
[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\Core\System;
16 use Friendica\DI;
17
18 function smoothly_init(App $a) {
19         Renderer::setActiveTemplateEngine('smarty3');
20
21         $cssFile = null;
22         $ssl_state = null;
23         $baseurl = System::baseUrl($ssl_state);
24         DI::page()['htmlhead'] .= <<< EOT
25
26 <script>
27 function cmtBbOpen(id) {
28         $(".comment-edit-bb-" + id).show();
29 }
30 function cmtBbClose(comment, id) {
31         $(".comment-edit-bb-" + id).hide();
32 }
33 $(document).ready(function() {
34
35         $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
36
37         $('.group-edit-icon').hover(
38                 function() {
39                         $(this).addClass('icon'); $(this).removeClass('iconspacer');},
40                 function() {
41                         $(this).removeClass('icon'); $(this).addClass('iconspacer');}
42         );
43
44         $('.sidebar-group-element').hover(
45                 function() {
46                         id = $(this).attr('id');
47                         $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
48
49                 function() {
50                         id = $(this).attr('id');
51                         $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
52         );
53
54
55         $('.savedsearchdrop').hover(
56                 function() {
57                         $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
58                 function() {
59                         $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
60         );
61
62         $('.savedsearchterm').hover(
63                 function() {
64                         id = $(this).attr('id');
65                         $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
66
67                 function() {
68                         id = $(this).attr('id');
69                         $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
70         );
71
72 });
73
74 </script>
75 EOT;
76
77         /** custom css **/
78         if (!is_null($cssFile)) {
79                 DI::page()['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
80         }
81
82         _js_in_foot();
83 }
84
85 if (! function_exists('_js_in_foot')) {
86         function _js_in_foot() {
87                 /** @purpose insert stuff in bottom of page
88                 */
89                 $ssl_state = null;
90                 $baseurl = System::baseUrl($ssl_state);
91                 $bottom['$baseurl'] = $baseurl;
92                 $tpl = Renderer::getMarkupTemplate('bottom.tpl');
93
94                 return DI::page()['bottom'] = Renderer::replaceMacros($tpl, $bottom);
95         }
96 }