~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to index.php

  • Committer: Keith Hughitt
  • Date: 2011-05-26 19:27:36 UTC
  • mto: This revision was merged to the branch mainline in revision 567.
  • Revision ID: keith.hughitt@nasa.gov-20110526192736-qyr0ltaiak33loik
Updated release notes and sample configuration file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
    // Accepted URL parameters
3
 
    // (except "imageLayers" and "eventLayers", handled separately)
4
 
    $params = array(
5
 
        'strings' => array('date', 'movieId', 'output'),
6
 
        'floats'  => array('centerX', 'centerY', 'imageScale'),
7
 
        'bools'   => array('debug', 'hideWatermark', 'eventLabels')
8
 
    );
9
 
 
10
 
    $urlSettings = array();
11
 
 
12
 
    // Check for URL params and cast to appropriate types
13
 
    foreach($params['strings'] as $str) {
14
 
        if (isset($_GET[$str]))
15
 
            $urlSettings[$str] = $_GET[$str];
16
 
    }
17
 
    foreach($params['floats'] as $float) {
18
 
        if (isset($_GET[$float]))
19
 
            $urlSettings[$float] = (float) $_GET[$float];
20
 
    }
21
 
    foreach($params['bools'] as $bool) {
22
 
        if ( isset($_GET[$bool]) &&
23
 
            (strtolower($_GET[$bool]) == 'true' || $_GET[$bool] == 1) ) {
24
 
 
25
 
            $urlSettings[$bool] = true;
 
2
$ini = "settings/Config.ini";
 
3
if ((!file_exists($ini)) || (!$config = parse_ini_file($ini)))
 
4
    die("Missing config file!");
 
5
// Remove variables that are not used on the client-side
 
6
unset($config['enable_statistics_collection']);
 
7
// Debug support
 
8
if (isset($_GET['debug']) && ((bool) $_GET['debug'] == true))
 
9
    $config['compress_js'] = $config['compress_css'] = false;
 
10
?>
 
11
<!DOCTYPE html>
 
12
<html lang="en">
 
13
<head>
 
14
    <?php printf("<!-- Helioviewer 2.2.0 (rev. %s), %s -->\n", $config["build_num"], $config["last_update"]);?>
 
15
    <title>Helioviewer - Solar and heliospheric image visualization tool</title>
 
16
    <meta charset="utf-8" />
 
17
    <meta name="description" content="Helioviewer - Solar and heliospheric image visualization tool" />
 
18
    <meta name="keywords" content="Helioviewer, jpeg 2000, jp2, solar image viewer, sun, solar, heliosphere, solar physics, viewer, visualization, space, astronomy, SOHO, EIT, LASCO, SDO, MDI, coronagraph, " />
 
19
    
 
20
    <?php if ($config["disable_cache"]) echo "<meta http-equiv=\"Cache-Control\" content=\"No-Cache\" />\n"; ?>
 
21
    
 
22
    <link rel="shortcut icon" href="favicon.ico" />
 
23
        
 
24
    <!--[if IE]>
 
25
    <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
 
26
    <![endif]-->
 
27
 
 
28
    <!-- YUI CSS Reset -->
 
29
    <link rel="stylesheet" href="lib/yui-2.8.2r1/reset-fonts.css" />
 
30
 
 
31
    <!-- Plugin Styles -->
 
32
    <link rel="stylesheet" href="lib/jquery.ui-1.8/css/dot-luv-modified/jquery-ui-1.8.12.custom.css" />  
 
33
    <link rel="stylesheet" href="lib/jquery.jgrowl/jquery.jgrowl.css" />
 
34
    <link rel="stylesheet" href="lib/jquery.imgareaselect-0.9.5/css/imgareaselect-default.css" />
 
35
    <link rel="stylesheet" href="lib/jquery.qTip2/jquery.qtip.min.css" />
 
36
 
 
37
    <!-- Helioviewer-Specific Styles -->
 
38
    <?php
 
39
 
 
40
        if ($config['disable_cache']) {
 
41
            $signature = time();
 
42
        } else {
 
43
            $signature = $config['build_num'];
26
44
        }
27
 
        else if ( isset($_GET[$bool]) &&
28
 
                 (strtolower($_GET[$bool]) == 'false' || $_GET[$bool] == 0) ) {
 
45
        $version = "rev=$signature";
29
46
 
30
 
            $urlSettings[$bool] = false;
 
47
        // CSS
 
48
        if ($config["compress_css"]) {
 
49
            echo "<link rel=\"stylesheet\" href=\"build/css/helioviewer.min.css?$version\" />\n    ";
31
50
        }
32
51
        else {
33
 
            unset($urlSettings[$bool]);
34
 
        }
35
 
    }
36
 
 
37
 
    // Process imageLayers separately if set
38
 
    if (isset($_GET['imageLayers']) && $_GET['imageLayers'] != '') {
39
 
        if ($_GET['imageLayers'][0] == '[') {
40
 
            $imageLayersString = substr($_GET['imageLayers'],1,-1);
41
 
        } else {
42
 
            $imageLayersString = $_GET['imageLayers'];
43
 
        }
44
 
        $urlSettings['imageLayers'] = preg_split("/\],\[/", $imageLayersString);
45
 
    }
46
 
    else {
47
 
        $urlSettings['imageLayers'] = '';
48
 
    }
49
 
 
50
 
    // Process eventLayers separately if set
51
 
    if (isset($_GET['eventLayers']) && $_GET['eventLayers'] != '') {
52
 
        if ($_GET['eventLayers'][0] == '[') {
53
 
            $eventLayersString = substr($_GET['eventLayers'],1,-1);
54
 
        } else {
55
 
            $eventLayersString = $_GET['eventLayers'];
56
 
        }
57
 
        $urlSettings['eventLayers'] = preg_split("/\],\[/", $eventLayersString);
58
 
    }
59
 
    else {
60
 
        $urlSettings['eventLayers'] = '';
61
 
    }
62
 
 
63
 
    // Default to HTML5 client
64
 
    if ( !isset($urlSettings['output']) ) {
65
 
        require_once 'src/php/HelioviewerWebClient.php';
66
 
        $helioviewer = new HelioviewerWebClient($urlSettings);
67
 
    }
68
 
    else if ( $urlSettings['output'] == 'embed' ) {
69
 
        // Embedded version of Helioviewer.org
70
 
        require_once 'src/php/HelioviewerEmbeddedClient.php';
71
 
        $helioviewer = new HelioviewerEmbeddedClient($urlSettings);
72
 
    }
73
 
?>
 
52
            $css = array("main", "layout", "accordions", "dialogs", 
 
53
                         "media-manager", "sliders", "timenav", 
 
54
                         "video-gallery", "viewport");
 
55
            foreach($css as $file)
 
56
                printf("<link rel=\"stylesheet\" href=\"resources/css/%s.css?$version\" />\n    ", $file);
 
57
        }
 
58
    ?>
 
59
 
 
60
    <!-- Theme Modifications -->
 
61
    <link rel="stylesheet" href="resources/css/dot-luv.css">
 
62
    <?php
 
63
        // Load Google Analytics if enabled 
 
64
        if ($config["google_analytics_id"]) {
 
65
    ?>
 
66
 
 
67
    <!-- Google Analytics -->
 
68
    <script type="text/javascript">
 
69
        var _gaq = _gaq || [];
 
70
        _gaq.push(['_setAccount', '<?php echo $config["google_analytics_id"];?>']);
 
71
        _gaq.push(['_trackPageview']);
 
72
        _gaq.push(['_trackPageLoadTime']);
 
73
        
 
74
        (function() {
 
75
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
 
76
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
 
77
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 
78
        }) ();
 
79
    </script>
 
80
    <?php
 
81
            }
 
82
?>
 
83
</head>
 
84
<body>
 
85
 
 
86
<!-- Header -->
 
87
<div id="header"></div>
 
88
 
 
89
<!-- Body -->
 
90
<div id="colmask">
 
91
    <div id="colmid">
 
92
        <div id="colright">
 
93
 
 
94
        <!-- Middle Column -->
 
95
        <div id="col1wrap">
 
96
            <div id="col1pad">
 
97
                <div id="col1">
 
98
                    <!-- Viewport -->
 
99
                    <div id="helioviewer-viewport-container-outer" class="ui-widget ui-widget-content ui-corner-all">
 
100
                        <div id="helioviewer-viewport-container-inner">
 
101
                            <div id="helioviewer-viewport">
 
102
                                <!-- Movement sandbox -->
 
103
                                <div id="sandbox" style="position: absolute;">
 
104
                                    <div id="moving-container"></div>
 
105
                                </div>
 
106
                                
 
107
                                <!-- Message console -->
 
108
                                <div id="message-console"></div>
 
109
                                
 
110
                                <!-- Image area select boundary container -->
 
111
                                <div id="image-area-select-container"></div>
 
112
                                
 
113
                            </div>
 
114
 
 
115
                            <!-- UI COMPONENTS -->
 
116
 
 
117
                            <!--  Zoom Controls -->
 
118
                            <div id="zoomControls">
 
119
                                <div id="zoomControlZoomIn" title="Zoom in.">+</div>
 
120
                                <div id="zoomSliderContainer">
 
121
                                    <div id="zoomControlSlider"></div>
 
122
                                </div>
 
123
                                <div id="zoomControlZoomOut" title="Zoom out.">-</div>
 
124
                            </div>
 
125
 
 
126
                            <!-- Center button -->
 
127
                            <div id="center-button" title="Center the image on the screen.">
 
128
                               <span>center</span>
 
129
                            </div>
 
130
 
 
131
                            <!--Social buttons -->
 
132
                            <div id="social-buttons">
 
133
                                <!-- Link button -->
 
134
                                <div id="link-button" class="text-btn" title="Get a link to the current page.">
 
135
                                    <span class="ui-icon ui-icon-link" style="float: left;"></span>
 
136
                                    <span style="line-height: 1.6em">Link</span>
 
137
                                </div>
 
138
 
 
139
                                <!-- Email button -->
 
140
                                <!--<div id="email-button" class="text-btn">
 
141
                                    <span class="ui-icon ui-icon-mail-closed" style="float: left;"></span>
 
142
                                    <span style="line-height: 1.6em">Email</span>
 
143
                                </div>-->
 
144
 
 
145
                                <!-- Movie button -->
 
146
                                <div id="movie-button" class="text-btn">
 
147
                                    <span class="ui-icon ui-icon-video" style="float: left;"></span>
 
148
                                    <span style="line-height: 1.6em">Movie</span>
 
149
                                </div>
 
150
 
 
151
                                <!-- Screenshot button -->
 
152
                                <div id="screenshot-button" class="text-btn">
 
153
                                    <span class="ui-icon ui-icon-image" style="float: left;"></span>
 
154
                                    <span style="line-height: 1.6em">Screenshot</span>
 
155
                                </div>
 
156
                                
 
157
                                <!-- Settings button -->
 
158
                                <div id="settings-button" class="text-btn" title="Open Helioviewer settings dialog.">
 
159
                                    <span class="ui-icon ui-icon-gear" style="float: left;"></span>
 
160
                                    <span style="line-height: 1.6em">Settings</span>
 
161
                                </div>
 
162
 
 
163
                                <!-- JHelioviewer -->
 
164
                                <!-- 2010/12/28: Disabling until JNLP launching is fixed -->
 
165
                                <!-- <div id="jhelioviewer-button" class="text-btn">
 
166
                                    <span class="ui-icon ui-icon-arrowthickstop-1-s" style="float: left;"></span>
 
167
                                    <span style="line-height: 1.6em">JHelioviewer</span>
 
168
                                </div> -->
 
169
                            </div>
 
170
 
 
171
                            <!-- Fullscreen toggle -->
 
172
                            <div id='fullscreen-btn' title="Toggle fullscreen display.">
 
173
                                <span class='ui-icon ui-icon-arrow-4-diag'></span>
 
174
                            </div>
 
175
 
 
176
                            <!-- Mouse coordinates display -->
 
177
                            <div id="mouse-coords" style="display: none;">
 
178
                                <div id="mouse-coords-x"></div>
 
179
                                <div id="mouse-coords-y"></div>
 
180
                            </div>
 
181
                            
 
182
                            <!-- Screenshot Manager -->
 
183
                            <div id='screenshot-manager-container' class='media-manager-container glow'>
 
184
                                <div id='screenshot-manager-build-btns' class='media-manager-build-btns'>
 
185
                                    <div id='screenshot-manager-full-viewport' class='text-btn'>
 
186
                                        <span class='ui-icon ui-icon-arrowthick-2-se-nw' style='float:left;'></span>
 
187
                                        <span style='line-height: 1.6em'>Full Viewport</span>
 
188
                                    </div>
 
189
                                    <div id='screenshot-manager-select-area' class='text-btn' style='float:right;'>
 
190
                                        <span class='ui-icon ui-icon-scissors' style='float:left;'></span>
 
191
                                        <span style='line-height: 1.6em'>Select Area</span> 
 
192
                                    </div>
 
193
                                </div>
 
194
                                <div id='screenshot-history-title' class='media-history-title'>
 
195
                                    Screenshot History    
 
196
                                    <div id='screenshot-clear-history-button' class='text-btn' style='float:right;'>
 
197
                                        <span class='ui-icon ui-icon-trash' style='float:left;'></span>
 
198
                                        <span style='font-weight:normal'><i>Clear</i></span>
 
199
                                    </div> 
 
200
                                </div>
 
201
                                <div id='screenshot-history'></div>
 
202
                            </div>
 
203
                            <!-- Movie Manager -->
 
204
                            <div id='movie-manager-container' class='media-manager-container glow'>
 
205
                                <div id='movie-manager-build-btns' class='media-manager-build-btns'>
 
206
                                    <div id='movie-manager-full-viewport' class='text-btn'>
 
207
                                        <span class='ui-icon ui-icon-arrowthick-2-se-nw' style='float:left;'></span>
 
208
                                        <span style='line-height: 1.6em'>Full Viewport</span>
 
209
                                    </div>
 
210
                                    <div id='movie-manager-select-area' class='text-btn' style='float:right;'>
 
211
                                        <span class='ui-icon ui-icon-scissors' style='float:left;'></span>
 
212
                                        <span style='line-height: 1.6em'>Select Area</span> 
 
213
                                    </div>
 
214
                                </div>
 
215
                                <div id='movie-history-title' class='media-history-title'>
 
216
                                    Movie History    
 
217
                                    <div id='movie-clear-history-button' class='text-btn' style='float:right;'>
 
218
                                        <span class='ui-icon ui-icon-trash' style='float:left;'></span>
 
219
                                        <span style='font-weight:normal'><i>Clear</i></span>
 
220
                                    </div> 
 
221
                                </div>
 
222
                                <div id='movie-history'></div>
 
223
                            </div>
 
224
 
 
225
                            <!-- Image area select tool -->
 
226
                            <div id='image-area-select-buttons'>
 
227
                                <div id='done-selecting-image' class='text-btn'>
 
228
                                    <span class='ui-icon ui-icon-circle-check'></span>
 
229
                                    <span>Done</span>
 
230
                                </div> 
 
231
                                <div id='cancel-selecting-image' class='text-btn'> 
 
232
                                    <span class='ui-icon ui-icon-circle-close'></span>
 
233
                                    <span>Cancel</span>
 
234
                                </div>
 
235
                                <div id='help-selecting-image' class='text-btn' style='float:right;'> 
 
236
                                    <span class='ui-icon ui-icon-info'></span>
 
237
                                </div>
 
238
                            </div>
 
239
                        </div>
 
240
 
 
241
 
 
242
                    </div>
 
243
                </div>
 
244
            </div>
 
245
        </div>
 
246
 
 
247
        <!-- Left Column -->
 
248
        <div id="col2">
 
249
            <div id="left-col-header">
 
250
                <a href='http://www.helioviewer.org'>
 
251
                    <img src="resources/images/logos/simple.png" id="helioviewer-logo-main" alt="Helioviewer.org Logo">
 
252
                </a>
 
253
            </div>
 
254
            <br><br>
 
255
            <div class="section-header" style="margin-left:5px; margin-top: 15px;">Time</div>
 
256
            <div id="observation-controls" class="ui-widget ui-widget-content ui-corner-all shadow">
 
257
                <!--  Observation Date -->
 
258
                <div id="observation-date-container">
 
259
                    <div id="observation-date-label">Date:</div>
 
260
                    <input type="text" id="date" name="date" value="" maxlength='10'>
 
261
                    <span id="timeNowBtn" title="Go to the time of the most recent available image for the currently loaded layers.">latest</span>
 
262
                </div>
 
263
 
 
264
                <!-- Observation Time -->
 
265
                <div id="observation-time-container">
 
266
                    <div id="observation-time-label">Time:</div>
 
267
                    <input id="time" name="time" value="" style="width:80px" type="text" maxlength="8" pattern="[\d]{2}:[\d]{2}:[\d]{2}">
 
268
                    <span style='font-size: 11px; font-weight: 700; margin-left: 2px;'>UTC</span>
 
269
                </div>
 
270
 
 
271
                <!-- Time Navigation Buttons & Time Increment selector -->
 
272
                <div>
 
273
                    <div id="time-navigation-buttons">Time-step:</div>
 
274
                    <select id="timestep-select" name="time-step"></select>
 
275
                    <span id="timeBackBtn" class="ui-icon ui-icon-circle-arrow-w" title="Move the Observation Date/Time backward one time-step"></span>
 
276
                    <span id="timeForwardBtn" class="ui-icon ui-icon-circle-arrow-e" title="Move the Observation Date/Time forward one time-step"></span>
 
277
                </div>
 
278
            </div>
 
279
 
 
280
            <br><br>
 
281
            <div id="tileLayerAccordion"></div>
 
282
            <br><br>
 
283
 
 
284
        </div>
 
285
 
 
286
        <!-- Right Column -->
 
287
        <div id="col3">
 
288
            <div id="right-col-header" style='height: 11px'></div>
 
289
            
 
290
            <!-- Recent Blog Entries -->
 
291
            <div style="margin-left: 5px; margin-top: 15px;" class="section-header">News</div>
 
292
            <div id="social-panel" class="ui-widget ui-widget-content ui-corner-all shadow"></div>
 
293
            
 
294
            <!-- User-Submitted Videos -->
 
295
            <div id="user-video-gallery-header" class="section-header">
 
296
                <a href="http://www.youtube.com/user/Helioviewer" target="_blank" style='text-decoration: none;'>
 
297
                    <img id='youtube-logo' src='resources/images/Social.me/48 by 48 pixels/youtube.png' alt='YouTube Logo' />
 
298
                </a>
 
299
                <span style='position: absolute; bottom: 5px;'>Recently Shared</span>
 
300
            </div>
 
301
            <div id="user-video-gallery" class="ui-widget ui-widget-content ui-corner-all shadow">
 
302
                <a id="user-video-gallery-next" href="#" title="Go to next page.">
 
303
                    <div class='ui-icon ui-icon-triangle-1-n'></div>
 
304
                </a>
 
305
                <div id="user-video-gallery-main">
 
306
                    <div id="user-video-gallery-spinner"></div>
 
307
                </div>
 
308
                <a id="user-video-gallery-prev" href="#" title="Go to previous page.">
 
309
                    <div class='ui-icon ui-icon-triangle-1-s'></div>
 
310
                </a>
 
311
            </div>
 
312
        </div>
 
313
        </div>
 
314
    </div>
 
315
</div>
 
316
<!-- end Body -->
 
317
 
 
318
<!-- Footer -->
 
319
<div id="footer">
 
320
    <div id="footer-container-outer">
 
321
        <div id="footer-container-inner">
 
322
            <!-- Meta links -->
 
323
            <div id="footer-links">
 
324
                <a href="http://helioviewer.org/wiki/Helioviewer.org_User_Guide" class="light" target="_blank">Help</a>
 
325
                <a id="helioviewer-about" class="light" href="dialogs/about.php">About</a>
 
326
                <a id="helioviewer-usage" class="light" href="dialogs/usage.php">Usage Tips</a>
 
327
                <a href="http://helioviewer.org/wiki/Main_Page" class="light" target="_blank">Wiki</a>
 
328
                <a href="http://helioviewer.org/blog" class="light" target="_blank">Blog</a>
 
329
                <a href="http://jhelioviewer.org" class="light" target="_blank">JHelioviewer</a>
 
330
                <a href="api/" class="light" target="_blank">API</a>
 
331
                <a href="mailto:contact@helioviewer.org" class="light">Contact</a>
 
332
                <a href="https://bugs.launchpad.net/helioviewer.org/" class="light" style="margin-right:2px;" target="_blank">Report Problem</a>
 
333
            </div>
 
334
        </div>
 
335
    </div>
 
336
</div>
 
337
<!-- end Footer -->
 
338
 
 
339
<!-- Loading Indicator -->
 
340
<div id="loading" style="display: none">Loading...</div>
 
341
 
 
342
<!-- Viewport shadow -->
 
343
<div id='helioviewer-viewport-container-shadow' class='shadow'></div>
 
344
 
 
345
<!-- About dialog -->
 
346
<div id='about-dialog'></div>
 
347
 
 
348
<!-- Layer choice dialog -->
 
349
<div id='layer-choice-dialog'></div>
 
350
 
 
351
<!-- Settings dialog -->
 
352
<div id='settings-dialog' style='display:none; margin: 15px; font-size: 1em;'>
 
353
    Movie Duration: 
 
354
    <select id='settings-movie-length' name='movie-length'>
 
355
        <option value='10800'>3 hours</option>
 
356
        <option value='21600'>6 hours</option>
 
357
        <option value='43200'>12 hours</option>
 
358
        <option value='86400'>1 day</option>
 
359
        <option value='172800'>2 days</option>
 
360
        <option value='604800'>1 week</option>
 
361
    </select>
 
362
    <br /><br />
 
363
    <span style='font-size: 0.8em;'><b>Note:</b> When making a movie, your current observation time will become the center
 
364
    of the movie. For example, if your observation time is set to "12:00:00" and you
 
365
    choose to make a 6 hour movie, then movie will start at "09:00:00" and end at "15:00:00".</span>
 
366
</div>
 
367
 
 
368
<!-- Usage Dialog -->
 
369
<div id='usage-dialog'></div>
 
370
 
 
371
<!-- URL Dialog -->
 
372
<div id='url-dialog' style="display:none;">
 
373
    <div id="helioviewer-url-box">
 
374
        Use the following link to refer to current page:
 
375
        <form style="margin-top: 5px;">
 
376
            <input type="text" id="helioviewer-url-input-box" style="width:98%;" value="http://helioviewer.org" />
 
377
        </form>
 
378
    </div>
 
379
</div>
 
380
 
 
381
<?php
 
382
    // Firebug Lite
 
383
    if (isset($_GET['fblite']) && ((bool) $_GET['fblite'] == true)) {
 
384
?>
 
385
<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>
 
386
<?php
 
387
    }
 
388
    if ($config["compress_js"]) {
 
389
?>
 
390
 
 
391
<!-- jQuery -->
 
392
<script src="http://code.jquery.com/jquery-1.6.min.js" type="text/javascript"></script>
 
393
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js" type="text/javascript"></script>
 
394
<script src="lib/jquery.class/jquery.class.min.js" type="text/javascript"></script>
 
395
 
 
396
<!-- Mousewheel support -->
 
397
<script src="lib/jquery.mousewheel.3.0.2/jquery.mousewheel.min.js" type="text/javascript"></script>
 
398
 
 
399
<!-- jGrowl -->
 
400
<script src="lib/jquery.jgrowl/jquery.jgrowl_minimized.js" type="text/javascript"></script>
 
401
 
 
402
<!-- imgAreaSelect jQuery plugin -->
 
403
<script src="lib/jquery.imgareaselect-0.9.5/scripts/jquery.imgareaselect.pack.js" type="text/javascript"></script>
 
404
 
 
405
<!-- date.js -->
 
406
<script src="lib/date.js/date-en-US.js" type="text/javascript"></script>
 
407
 
 
408
<!-- jFeed -->
 
409
<script src="lib/jquery.jfeed/build/jquery.jfeed.js" type="text/javascript"></script>
 
410
 
 
411
<!-- qTip -->
 
412
<script src="lib/jquery.qTip2/jquery.qtip.pack.js" type="text/javascript"></script>
 
413
 
 
414
<!-- XML to JSON -->
 
415
<script src="lib/jquery.xml2json/jquery.xml2json.pack.js" type="text/javascript" language="javascript"></script>
 
416
 
 
417
<?php
 
418
    } else {
 
419
?>
 
420
 
 
421
<!-- jQuery -->
 
422
<script src="http://code.jquery.com/jquery-1.6.js" type="text/javascript"></script>
 
423
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.js" type="text/javascript"></script>
 
424
<script src="lib/jquery.class/jquery.class.js" type="text/javascript"></script>
 
425
 
 
426
<!-- Mousewheel support -->
 
427
<script src="lib/jquery.mousewheel.3.0.2/jquery.mousewheel.js" type="text/javascript"></script>
 
428
 
 
429
<!-- jGrowl -->
 
430
<script src="lib/jquery.jgrowl/jquery.jgrowl.js" type="text/javascript"></script>
 
431
 
 
432
<!-- imgAreaSelect jQuery plugin -->
 
433
<script src="lib/jquery.imgareaselect-0.9.5/scripts/jquery.imgareaselect.js" type="text/javascript"></script>
 
434
 
 
435
<!-- date.js -->
 
436
<script src="lib/date.js/date-en-US.js" type="text/javascript"></script>
 
437
 
 
438
<!-- jFeed -->
 
439
<script src="lib/jquery.jfeed/build/jquery.jfeed.js" type="text/javascript"></script>
 
440
 
 
441
<!-- qTip -->
 
442
<script src="lib/jquery.qTip2/jquery.qtip.js" type="text/javascript"></script>
 
443
 
 
444
<!-- XML to JSON -->
 
445
<script src="lib/jquery.xml2json/jquery.xml2json.js" type="text/javascript" language="javascript"></script>
 
446
 
 
447
<?php
 
448
}
 
449
?>
 
450
<!-- CookieJar -->
 
451
<script type="text/javascript" src="lib/jquery.json-2.2/jquery.json-2.2.min.js"></script>
 
452
<script type="text/javascript" src="lib/jquery.cookie/jquery.cookie.min.js"></script>
 
453
<script type="text/javascript" src="lib/Cookiejar/jquery.cookiejar.pack.js"></script>
 
454
 
 
455
<!-- Simile -->
 
456
<!--<script src="http://static.simile.mit.edu/timeline/api-2.2.0/timeline-api.js" type="text/javascript"></script>-->
 
457
 
 
458
<!-- Pixastic -->
 
459
<!-- $("img.tile[src!=resources/images/transparent_512.gif]"); -->
 
460
<!--<script src="lib/pixastic/pixastic.custom.js" type="text/javascript"></script>-->
 
461
 
 
462
<!-- Helioviewer JavaScript -->
 
463
<?php 
 
464
    // JavaScript
 
465
    if ($config["compress_js"]) {
 
466
        $compressed = "build/helioviewer.min.js";
 
467
        if (!file_exists($compressed)) {
 
468
           $error = "<div style='position: absolute; width: 100%; text-align: center; top: 40%; font-size: 14px;'>
 
469
                     <img src='resources/images/logos/about.png' alt='helioviewer logo'></img><br>
 
470
                     <b>Configuration:</b> Unable to find compressed JavaScript files.
 
471
                     If you haven't already, use Apache Ant with the included build.xml file to generate 
 
472
                     compressed files.</div></body></html>";
 
473
           die($error);
 
474
        }
 
475
    
 
476
        echo "<script src=\"$compressed?$version\" type=\"text/javascript\"></script>\n\t";
 
477
    }
 
478
    else {
 
479
        $js = array("Utility/Config.js", "Utility/HelperFunctions.js", "UI/IconPicker.js", 
 
480
                    "Tiling/Layer/Layer.js", "Tiling/Layer/TileLoader.js", "Tiling/Layer/TileLayer.js", 
 
481
                    "Tiling/Layer/HelioviewerTileLayer.js", "UI/TreeSelect.js", "UI/ImageSelectTool.js",  
 
482
                    "Utility/KeyboardManager.js", "Tiling/Manager/LayerManager.js", "Events/EventManager.js", 
 
483
                    "Tiling/Manager/TileLayerManager.js", "Tiling/Manager/HelioviewerTileLayerManager.js", 
 
484
                    "Events/EventType.js", "Events/EventFeatureRecognitionMethod.js", "Media/MediaManagerUI.js",
 
485
                    "Media/MediaManager.js", "Media/MovieManager.js", "Media/MovieManagerUI.js",
 
486
                    "Media/ScreenshotManager.js", "Media/ScreenshotManagerUI.js",  
 
487
                    "Image/JP2Image.js", "Tiling/Manager/TileLayerAccordion.js", "UI/MessageConsole.js",
 
488
                    "UI/TimeControls.js", "Utility/SettingsLoader.js", "Utility/UserSettings.js", 
 
489
                    "Utility/FullscreenControl.js", "Viewport/Helper/MouseCoordinates.js", "Viewport/Viewport.js", 
 
490
                    "Viewport/Helper/HelioviewerMouseCoordinates.js", "Viewport/Helper/SandboxHelper.js",
 
491
                    "Viewport/Helper/ViewportMovementHelper.js", "Viewport/HelioviewerViewport.js", 
 
492
                    "Viewport/ViewportController.js", "Helioviewer.js", "UI/ZoomControls.js", "UI/UserVideoGallery.js", 
 
493
                    "Utility/InputValidator.js", "UI/jquery.ui.dynaccordion.js");
 
494
        foreach($js as $file)
 
495
            printf("<script src=\"src/%s?$version\" type=\"text/javascript\"></script>\n", $file);
 
496
    }
 
497
?>
 
498
 
 
499
<script type="text/javascript">
 
500
    var serverSettings, settingsJSON, urlSettings;
 
501
 
 
502
    $(function () {
 
503
        <?php
 
504
            printf("settingsJSON = %s;\n", json_encode($config));
 
505
 
 
506
            // Settings specified via URL parameters
 
507
            $urlSettings = array();
 
508
 
 
509
            //API Example: helioviewer.org/?date=2003-10-05T00:00:00Z&imageScale=2.4&imageLayers=[SOHO,AIA,AIA,171,1,70],[SOHO,LASCO,C2,white light,0,100]
 
510
            if (isset($_GET['imageLayers'])) {
 
511
                $imageLayersString = ($_GET['imageLayers'][0] == "[") ? substr($_GET['imageLayers'],1,-1) : $_GET['imageLayers'];
 
512
                $imageLayers = preg_split("/\],\[/", $imageLayersString);
 
513
                $urlSettings['imageLayers'] = $imageLayers;
 
514
            }
 
515
 
 
516
            if (isset($_GET['date']))
 
517
                $urlSettings['date'] = $_GET['date'];
 
518
 
 
519
            if (isset($_GET['imageScale']))
 
520
                $urlSettings['imageScale'] = $_GET['imageScale'];
 
521
 
 
522
            // Convert to JSON
 
523
            printf("\turlSettings = %s;\n", json_encode($urlSettings));
 
524
        ?>
 
525
        serverSettings = new Config(settingsJSON).toArray();
 
526
        helioviewer    = new Helioviewer(urlSettings, serverSettings);
 
527
    });
 
528
</script>
 
529
 
 
530
</body>
 
531
</html>