source: documented-examples/trunk/style-e/macros/extra.dm@ 21010

Last change on this file since 21010 was 19119, checked in by kjdon, 15 years ago

updated links to stylesheets

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#documented extra.dm macro file for Greenstone CSS/style demo collection
2
3package Style
4
5# we override the default cssheader macro here so we don't get the
6# hard-coded background images. This is the place to make your customisations
7# This collection has a copy of the default CSS in _httpcstyle_
8# (_httpcollection_/style) instead of _httpimages_
9
10_cssheader_ {
11<link rel="stylesheet" href="_httpcstyle_/gs.css" type="text/css"
12 title="Default Greenstone Style" charset="UTF-8">
13<link rel="alternate stylesheet" href="_httpcstyle_/style-blue.css"
14 type="text/css" title="Ocean Blue" charset="UTF-8" media="screen">
15<link rel="alternate stylesheet" href="_httpcstyle_/style-red.css"
16 type="text/css" title="Fire Red" charset="UTF-8" media="screen">
17<link rel="alternate stylesheet" href="_httpimages_/style-print.css"
18 type="text/css" title="Printer" charset="UTF-8" media="print, screen">
19<link rel="stylesheet" href="_httpimages_/style-print.css"
20 type="text/css" charset="UTF-8" media="print">
21}
22
23#### extra code to allow changing stylesheet
24
25# extra javascript, for our demo toggle buttons
26# go through all styles and disable them all except the wanted one
27# For some reason, this macro overrides the _query:pagescriptextra_ even
28# though it's for the Style package only, so we need a defined initialize()
29# function or else we get a javascript error.
30
31_pagescriptextra_ {
32
33function SetStyle(stylename) \{
34 var body = document.getElementsByTagName('body')[0];
35 body.style.backgroundImage = "";
36
37 styles = document.styleSheets;
38 var i;
39 for (i=0;i<styles.length;i++) \{
40 style = styles[i];
41 if (style.title == stylename)
42 style.disabled = false;
43 else
44 style.disabled = true;
45 \}
46\}
47
48function initialize() \{ \}
49
50}
51
52_navbarspacer_ {<span class="spaceextra"></span>}
53
54# override the default navigation bar to add demo style toggle buttons
55
56_optnavigationbar_ {
57<p class="choose_style">
58Choose a style: <a href="#" onclick="SetStyle('Default Greenstone Style');return false;">Default Greenstone</a>,
59<a href="#" onclick="SetStyle('Ocean Blue');return false;">Blue</a>,
60<a href="#" onclick="SetStyle('Fire Red');return false;">Red</a>,
61<a href="#" onclick="SetStyle('Printer');return false;">Printer</a>,
62<a href="#" onclick="SetStyle('');return false;">None</a>
63</p>
64<div class="navbar">
65<p class="navbar">
66_navigationbar_
67</p>
68</div>
69}
70
71#### some text strings
72#_choosestyle_ "Choose a style"
73#_choosestyle_ [l=fr] "choisissez un style"
74
Note: See TracBrowser for help on using the repository browser.