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
23 $colour = get_pconfig(local_user(), "dispy", "colour");
24 $baseurl = $a->get_baseurl($ssl_state);
26 if ($colour === false) { $colour = "light"; }
27 if ($colour == "light") {
28 $colour_path = "/light/";
29 require_once ('light/theme.php');
31 if ($colour == "dark") {
32 $colour_path = "/dark/";
33 require_once ('dark/theme.php');
36 /** @purpose aside on profile page
38 if (($a->argv[0] . $a->argv[1]) === ("profile" . $a->user['nickname'])) {
39 dispy_community_info();
42 $a->page['htmlhead'] .= <<<EOT
43 <script type="text/javascript" src="$baseurl/view/theme/dispy/js/modernizr.custom.2.5.3.min.js"></script>
44 <script type="text/javascript">
45 $(document).ready(function() {
46 // Select all links with lightbox class
47 $("a.lightbox").fancybox();
49 $('.group-edit-icon').hover(
51 $(this).addClass('icon');
52 $(this).removeClass('iconspacer'); },
55 $(this).removeClass('icon');
56 $(this).addClass('iconspacer'); }
59 $('.sidebar-group-element').hover(
61 id = $(this).attr('id');
62 $('#edit-' + id).addClass('icon');
63 $('#edit-' + id).removeClass('iconspacer'); },
66 id = $(this).attr('id');
67 $('#edit-' + id).removeClass('icon');
68 $('#edit-' + id).addClass('iconspacer'); }
71 $('.savedsearchdrop').hover(
73 $(this).addClass('drop');
74 $(this).addClass('icon');
75 $(this).removeClass('iconspacer'); },
78 $(this).removeClass('drop');
79 $(this).removeClass('icon');
80 $(this).addClass('iconspacer'); }
83 $('.savedsearchterm').hover(
85 id = $(this).attr('id');
86 $('#drop-' + id).addClass('icon');
87 $('#drop-' + id).addClass('drophide');
88 $('#drop-' + id).removeClass('iconspacer'); },
91 id = $(this).attr('id');
92 $('#drop-' + id).removeClass('icon');
93 $('#drop-' + id).removeClass('drophide');
94 $('#drop-' + id).addClass('iconspacer'); }
97 // click outside notifications menu closes it
98 $('html').click(function() {
99 $('#nav-notifications-linkmenu').removeClass('selected');
100 $('#nav-notifications-menu').css({display: 'none'});
103 $('#nav-notifications-linkmenu').click(function(event) {
104 event.stopPropagation();
106 // click outside profiles menu closes it
107 $('html').click(function() {
108 $('#profiles-menu-trigger').removeClass('selected');
109 $('#profiles-menu').css({display: 'none'});
112 $('#profiles-menu').click(function(event) {
113 event.stopPropagation();
116 // main function in toolbar functioning
117 function toggleToolbar() {
118 if ( $('#nav-floater').is(':visible') ) {
119 $('#nav-floater').slideUp('fast');
120 $('.floaterflip').css({
121 backgroundPosition: '-210px -60px'
123 $('.search-box').slideUp('fast');
125 $('#nav-floater').slideDown('fast');
126 $('.floaterflip').css({
127 backgroundPosition: '-190px -60px'
129 $('.search-box').slideDown('fast');
132 // our trigger for the toolbar button
133 $('.floaterflip').click(function() {
138 // (attempt to) change the text colour in a top post
139 $('#profile-jot-text').focusin(function() {
140 $(this).css({color: '#eec'});
143 $('a[href=#top]').click(function() {
144 $('html, body').animate({scrollTop:0}, 'slow');
149 // shadowing effect for floating toolbars
150 $(document).scroll(function(e) {
151 var pageTop = $('html').scrollTop();
153 $('#nav-floater').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
154 $('.search-box').css({boxShadow: '3px 3px 10px rgba(0, 0, 0, 0.7)'});
156 $('#nav-floater').css({boxShadow: '0 0 0 0'});
157 $('.search-box').css({boxShadow: '0 0 0 0'});
164 if (!is_null($cssFile)) {
165 $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
171 function dispy_community_info() {
172 /** @purpose some sidebar stuff for new users
175 $url = $a->get_baseurl($ssl_state);
176 $aside['$url'] = $url;
178 $tpl = file_get_contents(dirname(__file__) . '/communityhome.tpl');
179 return $a->page['aside_bottom'] = replace_macros($tpl, $aside);
182 function js_in_foot() {
183 /** @purpose insert stuff in bottom of page
186 $baseurl = $a->get_baseurl($ssl_state);
187 $bottom['$baseurl'] = $baseurl;
188 $tpl = file_get_contents(dirname(__file__) . '/bottom.tpl');
190 return $a->page['bottom'] = replace_macros($tpl, $bottom);