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