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 $baseurl = $a->get_baseurl($ssl_state);
27 if ($colour === false) { $colour = "light"; }
28 if ($colour == "light") {
29 $colour_path = "/light/";
30 require_once ('light/theme.php');
32 if ($colour == "dark") {
33 $colour_path = "/dark/";
34 require_once ('dark/theme.php');
37 /** @purpose aside on profile page
39 if (($a->argv[0] . $a->argv[1]) === ("profile" . $a->user['nickname'])) {
40 dispy_community_info();
43 $a->page['htmlhead'] .= <<<EOT
44 <script type="text/javascript" src="$baseurl/view/theme/dispy/js/modernizr.custom.2.5.3.min.js"></script>
45 <script type="text/javascript">
46 $(document).ready(function() {
47 $('.group-edit-icon').hover(
49 $(this).addClass('icon');
50 $(this).removeClass('iconspacer'); },
53 $(this).removeClass('icon');
54 $(this).addClass('iconspacer'); }
57 $('.sidebar-group-element').hover(
59 id = $(this).attr('id');
60 $('#edit-' + id).addClass('icon');
61 $('#edit-' + id).removeClass('iconspacer'); },
64 id = $(this).attr('id');
65 $('#edit-' + id).removeClass('icon');
66 $('#edit-' + id).addClass('iconspacer'); }
69 $('.savedsearchdrop').hover(
71 $(this).addClass('drop');
72 $(this).addClass('icon');
73 $(this).removeClass('iconspacer'); },
76 $(this).removeClass('drop');
77 $(this).removeClass('icon');
78 $(this).addClass('iconspacer'); }
81 $('.savedsearchterm').hover(
83 id = $(this).attr('id');
84 $('#drop-' + id).addClass('icon');
85 $('#drop-' + id).addClass('drophide');
86 $('#drop-' + id).removeClass('iconspacer'); },
89 id = $(this).attr('id');
90 $('#drop-' + id).removeClass('icon');
91 $('#drop-' + id).removeClass('drophide');
92 $('#drop-' + id).addClass('iconspacer'); }
95 // click outside notifications menu closes it
96 $('html').click(function() {
97 $('#nav-notifications-linkmenu').removeClass('selected');
98 $('#nav-notifications-menu').css({display: 'none'});
101 $('#nav-notifications-linkmenu').click(function(event) {
102 event.stopPropagation();
104 // click outside profiles menu closes it
105 $('html').click(function() {
106 $('#profiles-menu-trigger').removeClass('selected');
107 $('#profiles-menu').css({display: 'none'});
110 $('#profiles-menu').click(function(event) {
111 event.stopPropagation();
114 // main function in toolbar functioning
115 function toggleToolbar() {
116 if ( $('#nav-floater').is(':visible') ) {
117 $('#nav-floater').slideUp('fast');
118 $('.floaterflip').css({
119 backgroundPosition: '-210px -60px'
121 $('.search-box').slideUp('fast');
123 $('#nav-floater').slideDown('fast');
124 $('.floaterflip').css({
125 backgroundPosition: '-190px -60px'
127 $('.search-box').slideDown('fast');
130 // our trigger for the toolbar button
131 $('.floaterflip').click(function() {
136 // (attempt to) change the text colour in a top post
137 $('#profile-jot-text').focusin(function() {
138 $(this).css({color: '#eec'});
141 $('a[href=#top]').click(function() {
142 $('html, body').animate({scrollTop:0}, 'slow');
147 // shadowing effect for floating toolbars
148 $(document).scroll(function(e) {
149 var pageTop = $('html').scrollTop();
151 $('#nav-floater').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
152 $('.search-box').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
154 $('#nav-floater').css({boxShadow: '0 0 0 0'});
155 $('.search-box').css({boxShadow: '0 0 0 0'});
162 if (!is_null($cssFile)) {
163 $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
169 function dispy_community_info() {
170 /** @purpose some sidebar stuff for new users
173 $url = $a->get_baseurl($ssl_state);
174 $aside['$url'] = $url;
176 $tpl = file_get_contents(dirname(__file__) . '/communityhome.tpl');
177 return $a->page['aside_bottom'] = replace_macros($tpl, $aside);
180 function js_in_foot() {
181 /** @purpose insert stuff in bottom of page
184 $baseurl = $a->get_baseurl($ssl_state);
185 $bottom['$baseurl'] = $baseurl;
186 $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl');
188 return $a->page['bottom'] = replace_macros($tpl, $bottom);