5 * Description: Dispy Dark, Friendica theme
7 * Author: Simon <http://simon.kisikew.org/>
8 * Maintainer: Simon <http://simon.kisikew.org/>
9 * Screenshot: <a href="screenshot.jpg">Screenshot</a>
13 $a->theme_info = array(
14 'name' => 'dispy-dark',
18 function dispy_dark_init(&$a) {
20 // aside on profile page
21 if (($a->argv[0] . $a->argv[1]) === ("profile" . $a->user['nickname'])) {
22 dispy_dark_community_info();
25 $a->page['htmlhead'] .= <<<EOT
26 <script type="text/javascript">
27 $(document).ready(function() {
28 $('.group-edit-icon').hover(
30 $(this).addClass('icon');
31 $(this).removeClass('iconspacer'); },
34 $(this).removeClass('icon');
35 $(this).addClass('iconspacer'); }
38 $('.sidebar-group-element').hover(
40 id = $(this).attr('id');
41 $('#edit-' + id).addClass('icon');
42 $('#edit-' + id).removeClass('iconspacer'); },
45 id = $(this).attr('id');
46 $('#edit-' + id).removeClass('icon');
47 $('#edit-' + id).addClass('iconspacer'); }
50 $('.savedsearchdrop').hover(
52 $(this).addClass('drop');
53 $(this).addClass('icon');
54 $(this).removeClass('iconspacer'); },
57 $(this).removeClass('drop');
58 $(this).removeClass('icon');
59 $(this).addClass('iconspacer'); }
62 $('.savedsearchterm').hover(
64 id = $(this).attr('id');
65 $('#drop-' + id).addClass('icon');
66 $('#drop-' + id).addClass('drophide');
67 $('#drop-' + id).removeClass('iconspacer'); },
70 id = $(this).attr('id');
71 $('#drop-' + id).removeClass('icon');
72 $('#drop-' + id).removeClass('drophide');
73 $('#drop-' + id).addClass('iconspacer'); }
76 // click outside notifications menu closes it
77 $('html').click(function() {
78 $('#nav-notifications-linkmenu').removeClass('selected');
79 $('#nav-notifications-menu').css({display: 'none'});
82 $('#nav-notifications-linkmenu').click(function(event) {
83 event.stopPropagation();
85 // click outside profiles menu closes it
86 $('html').click(function() {
87 $('#profiles-menu-trigger').removeClass('selected');
88 $('#profiles-menu').css({display: 'none'});
91 $('#profiles-menu').click(function(event) {
92 event.stopPropagation();
95 // main function in toolbar functioning
96 function toggleToolbar() {
97 if ( $('#nav-floater').is(':visible') ) {
98 $('#nav-floater').slideUp('fast');
99 $('.floaterflip').css({
100 backgroundPosition: '-210px -60px'
102 $('.search-box').slideUp('fast');
104 $('#nav-floater').slideDown('fast');
105 $('.floaterflip').css({
106 backgroundPosition: '-190px -60px'
108 $('.search-box').slideDown('fast');
111 // our trigger for the toolbar button
112 $('.floaterflip').click(function() {
117 // (attempt to) change the text colour in a top post
118 $('#profile-jot-text').focusin(function() {
119 $(this).css({color: '#eec'});
122 $('a[href=#top]').click(function() {
123 $('html, body').animate({scrollTop:0}, 'slow');
128 // shadowing effect for floating toolbars
129 $(document).scroll(function(e) {
130 var pageTop = $('html').scrollTop();
132 $('#nav-floater').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
133 $('.search-box').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
135 $('#nav-floater').css({boxShadow: '0 0 0 0'});
136 $('.search-box').css({boxShadow: '0 0 0 0'});
145 function dispy_dark_community_info() {
147 $url = $a->get_baseurl($ssl_state);
148 $aside['$url'] = $url;
150 $tpl = file_get_contents(dirname(__file__) . '/communityhome.tpl');
151 return $a->page['aside_bottom'] = replace_macros($tpl, $aside);
154 function js_in_foot() {
155 /** @purpose insert stuff in bottom of page
158 $baseurl = $a->get_baseurl($ssl_state);
159 $bottom['$baseurl'] = $baseurl;
160 $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl');
162 return $a->page['bottom'] = replace_macros($tpl, $bottom);