diff --git a/inc/class.page.php b/inc/class.page.php --- a/inc/class.page.php +++ b/inc/class.page.php @@ -125,6 +125,7 @@ class page $this->headCode['jQueryUI'] = ''; $this->headCode['jValidate'] = ''; $this->headCode['jAddress'] = ''; + $this->headCode['jQuery.cuteTime'] = ''; $this->headCode['qTip'] = ''; $this->headCode['qTip2'] = ''; $this->headCode['schedInput'] = ''; @@ -258,14 +259,24 @@ class page ' '. PHP_EOL . ' ' . PHP_EOL - . $this->script_wrap('' - . 'var slate_permutate_school = ' . json_encode($this->school['id']) . ';' . PHP_EOL - . 'var slate_permutate_semester = ' . json_encode($this->semester['id']) . ';' . PHP_EOL); + . ' ' . PHP_EOL; // Write out all passed scripts foreach ($this->scripts as $i) echo ' ' . $this->headCode["$i"] . "\n"; + /* + * Perhaps we should have a separate array for javascript library + * initialization snippets. + */ + $javascript_init = ''; + if (in_array('jQuery.cuteTime', $this->scripts)) + $javascript_init .= 'jQuery.extend(jQuery.fn.cuteTime.settings, {refresh: 10000, use_html_attribute: false});' . PHP_EOL; + + echo $this->script_wrap('' + . 'var slate_permutate_school = ' . json_encode($this->school['id']) . ';' . PHP_EOL + . 'var slate_permutate_semester = ' . json_encode($this->semester['id']) . ';' . PHP_EOL + . $javascript_init); + $selectschool_query = '&school=' . $this->school['id']; /* kludge */ if (!empty($_REQUEST['s']))