5 * Description: <p style="white-space:pre;"> Dispy: Light, Spartan, Sleek, and Functional<br /> Dispy Dark: Dark, Spartan, Sleek, and Functional</p>
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(
18 function dispy_init(&$a) {
20 /** @purpose set some theme defaults
24 $colour = get_pconfig(local_user(), "dispy", "colour");
25 if ($colour === false) { $colour = "light"; }
26 if ($colour == "light") {
27 $colour_path = "/light/";
28 require_once ('light/theme.php');
30 if ($colour == "dark") {
31 $colour_path = "/dark/";
32 require_once ('dark/theme.php');
35 /** @purpose aside on profile page
37 if (($a->argv[0] . $a->argv[1]) === ("profile" . $a->user['nickname'])) {
38 dispy_community_info();
41 $a->page['htmlhead'] .= <<<EOT
42 <script type="text/javascript">
43 $(document).ready(function() {
44 $('.group-edit-icon').hover(
46 $(this).addClass('icon');
47 $(this).removeClass('iconspacer'); },
50 $(this).removeClass('icon');
51 $(this).addClass('iconspacer'); }
54 $('.sidebar-group-element').hover(
56 id = $(this).attr('id');
57 $('#edit-' + id).addClass('icon');
58 $('#edit-' + id).removeClass('iconspacer'); },
61 id = $(this).attr('id');
62 $('#edit-' + id).removeClass('icon');
63 $('#edit-' + id).addClass('iconspacer'); }
66 $('.savedsearchdrop').hover(
68 $(this).addClass('drop');
69 $(this).addClass('icon');
70 $(this).removeClass('iconspacer'); },
73 $(this).removeClass('drop');
74 $(this).removeClass('icon');
75 $(this).addClass('iconspacer'); }
78 $('.savedsearchterm').hover(
80 id = $(this).attr('id');
81 $('#drop-' + id).addClass('icon');
82 $('#drop-' + id).addClass('drophide');
83 $('#drop-' + id).removeClass('iconspacer'); },
86 id = $(this).attr('id');
87 $('#drop-' + id).removeClass('icon');
88 $('#drop-' + id).removeClass('drophide');
89 $('#drop-' + id).addClass('iconspacer'); }
92 // click outside notifications menu closes it
93 $('html').click(function() {
94 $('#nav-notifications-linkmenu').removeClass('selected');
95 $('#nav-notifications-menu').css({display: 'none'});
98 $('#nav-notifications-linkmenu').click(function(event) {
99 event.stopPropagation();
101 // click outside profiles menu closes it
102 $('html').click(function() {
103 $('#profiles-menu-trigger').removeClass('selected');
104 $('#profiles-menu').css({display: 'none'});
107 $('#profiles-menu').click(function(event) {
108 event.stopPropagation();
111 // main function in toolbar functioning
112 function toggleToolbar() {
113 if ( $('#nav-floater').is(':visible') ) {
114 $('#nav-floater').slideUp('fast');
115 $('.floaterflip').css({
116 backgroundPosition: '-210px -60px'
118 $('.search-box').slideUp('fast');
120 $('#nav-floater').slideDown('fast');
121 $('.floaterflip').css({
122 backgroundPosition: '-190px -60px'
124 $('.search-box').slideDown('fast');
127 // our trigger for the toolbar button
128 $('.floaterflip').click(function() {
133 // (attempt to) change the text colour in a top post
134 $('#profile-jot-text').focusin(function() {
135 $(this).css({color: '#eec'});
138 $('a[href=#top]').click(function() {
139 $('html, body').animate({scrollTop:0}, 'slow');
144 // shadowing effect for floating toolbars
145 $(document).scroll(function(e) {
146 var pageTop = $('html').scrollTop();
148 $('#nav-floater').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
149 $('.search-box').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
151 $('#nav-floater').css({boxShadow: '0 0 0 0'});
152 $('.search-box').css({boxShadow: '0 0 0 0'});
159 if (!is_null($cssFile)) {
160 $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
166 function dispy_community_info() {
167 /** @purpose some sidebar stuff for new users
170 $url = $a->get_baseurl($ssl_state);
171 $aside['$url'] = $url;
173 $tpl = file_get_contents(dirname(__file__) . '/communityhome.tpl');
174 return $a->page['aside_bottom'] = replace_macros($tpl, $aside);
177 function js_in_foot() {
178 /** @purpose insert stuff in bottom of page
181 $baseurl = $a->get_baseurl($ssl_state);
182 $bottom['$baseurl'] = $baseurl;
183 $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl');
185 return $a->page['bottom'] = replace_macros($tpl, $bottom);