]> git.mxchange.org Git - friendica.git/blob - view/theme/dispy/theme.php
d0f6797cbaa92c617dfc1f55f4b2c02a768b750c
[friendica.git] / view / theme / dispy / theme.php
1 <?php
2
3 /*
4  * Name: Dispy
5  * Description: Dispy, Friendica theme
6  * Version: 1.0
7  * Author: unknown
8  * Maintainer: Simon <http://simon.kisikew.org/>
9  * Screenshot: <a href="screenshot.jpg">Screenshot</a>
10  */
11
12 $a->theme_info = array(
13         'extends' => 'dispy',
14 );
15
16 $a->page['htmlhead'] .= <<< EOT
17 <script>
18 $(document).ready(function() {
19     $('.group-edit-icon').hover(
20         function() {
21             $(this).addClass('icon');
22             $(this).removeClass('iconspacer'); },
23
24         function() {
25             $(this).removeClass('icon');
26             $(this).addClass('iconspacer'); }
27     );
28
29     $('.sidebar-group-element').hover(
30         function() {
31             id = $(this).attr('id');
32             $('#edit-' + id).addClass('icon');
33             $('#edit-' + id).removeClass('iconspacer'); },
34
35         function() {
36             id = $(this).attr('id');
37             $('#edit-' + id).removeClass('icon');
38             $('#edit-' + id).addClass('iconspacer'); }
39     );
40
41     $('.savedsearchdrop').hover(
42         function() {
43             $(this).addClass('drop');
44             $(this).addClass('icon');
45             $(this).removeClass('iconspacer'); },
46
47         function() {
48             $(this).removeClass('drop');
49             $(this).removeClass('icon');
50             $(this).addClass('iconspacer'); }
51     );
52
53     $('.savedsearchterm').hover(
54         function() {
55             id = $(this).attr('id');
56             $('#drop-' + id).addClass('icon');
57             $('#drop-' + id).addClass('drophide');
58             $('#drop-' + id).removeClass('iconspacer'); },
59
60         function() {
61             id = $(this).attr('id');
62             $('#drop-' + id).removeClass('icon');
63             $('#drop-' + id).removeClass('drophide');
64             $('#drop-' + id).addClass('iconspacer'); }
65         );
66
67         // click outside notifications menu closes it
68         $('html').click(function() {
69                 $('#nav-notifications-linkmenu').removeClass('selected');
70                 document.getElementById("nav-notifications-menu").style.display = "none";
71         });
72
73         $('#nav-notifications-linkmenu').click(function(event) {
74                 event.stopPropagation();
75         });
76         // click outside profiles menu closes it
77         $('html').click(function() {
78                 $('#profiles-menu-trigger').removeClass('selected');
79                 document.getElementById("profiles-menu").style.display = "none";
80         });
81
82         $('#profiles-menu').click(function(event) {
83                 event.stopPropagation();
84         });
85
86         // main function in toolbar functioning
87     function toggleToolbar() {
88         if ( $('#nav-floater').is(':visible') ) {
89             $('#nav-floater').slideUp('fast');
90             $('.floaterflip').css({
91                 backgroundPosition: '-210px -60px' 
92             });
93                         $('.search-box').slideUp('fast');
94         } else {
95             $('#nav-floater').slideDown('fast');
96             $('.floaterflip').css({
97                 backgroundPosition: '-190px -60px'
98             });
99                         $('.search-box').slideDown('fast');
100         }
101     };
102         // our trigger for the toolbar button
103     $('.floaterflip').click(function() {
104         toggleToolbar();
105         return false;
106     });
107
108         // (attempt) to change the text colour in a top post
109         $('#profile-jot-text').focusin(function() {
110                 $(this).css({color: '#eec'});
111         });
112
113 });
114 </script>
115 EOT;
116
117 function dispy_community_info() {
118         $a = get_app();
119
120         $fostitJS = "javascript: (function() {
121                 the_url = '".$a->get_baseurl($ssl_state)."/view/theme/dispy-dark/fpostit/fpostit.php?url=' +
122                 encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title) + '&text=' +
123                 encodeURIComponent(''+(window.getSelection ? window.getSelection() : document.getSelection ?
124                 document.getSelection() : document.selection.createRange().text));
125                 a_funct = function() {
126                         if (!window.open(the_url, 'fpostit', 'location=yes,links=no,scrollbars=no,toolbar=no,width=600,height=300')) {
127                                 location.href = the_url;
128                         }
129                         if (/Firefox/.test(navigator.userAgent)) {
130                                 setTimeout(a_funct, 0)
131                         } else {
132                                 a_funct();
133                         }
134                 })();";
135
136         $aside['$fostitJS'] = $fostitJS;
137         $url = $a->get_baseurl($ssl_state);
138         $aside['$url'] = $url;
139
140     $tpl = file_get_contents(dirname(__file__).'/communityhome.tpl');
141         $a->page['aside_bottom'] = replace_macros($tpl, $aside);
142 }
143
144 // aside on profile page
145 if (($a->argv[0] . $a->argv[1]) === ("profile" . $a->user['nickname'])) {
146         dispy_community_info();
147 }