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 document.getElementById("nav-notifications-menu").style.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 document.getElementById("profiles-menu").style.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'});
127 function dispy_dark_community_info() {
129 $url = $a->get_baseurl($ssl_state);
130 $aside['$url'] = $url;
133 javascript: (function() {
134 the_url = ' . $url . '/view/theme/' . $a->theme_info['name'] . '/fpostit/fpostit.php?url=' +
135 encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title) + '&text=' +
136 encodeURIComponent(''+(window.getSelection ? window.getSelection() : document.getSelection ?
137 document.getSelection() : document.selection.createRange().text));
138 a_funct = function() {
139 if (!window.open(the_url, 'fpostit', 'location=yes,links=no,scrollbars=no,toolbar=no,width=600,height=300')) {
140 location.href = the_url;
142 if (/Firefox/.test(navigator.userAgent)) {
143 setTimeout(a_funct, 0)
150 $aside['$fpostitJS'] = $fpostitJS;
151 $tpl = file_get_contents(dirname(__file__) . '/communityhome.tpl');
152 return $a->page['aside_bottom'] = replace_macros($tpl, $aside);