From 435cc81395b87ea57ac5b81dbb55c08b199bc574 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 30 Jul 2010 11:30:30 -0600 Subject: [PATCH] Clean up some javascript defs in kronolith --- kronolith/js/calendar-panel.js | 2 +- kronolith/js/edit.js | 2 ++ kronolith/js/goto.js | 2 +- kronolith/js/views.js | 4 ++-- kronolith/templates/common-header.inc | 6 ------ kronolith/templates/edit/edit.inc | 3 --- kronolith/templates/javascript_defs.php | 5 ++++- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/kronolith/js/calendar-panel.js b/kronolith/js/calendar-panel.js index 6ae93e683..5ff6fb3b7 100644 --- a/kronolith/js/calendar-panel.js +++ b/kronolith/js/calendar-panel.js @@ -16,7 +16,7 @@ function sbarToggle() document.observe('dom:loaded', function() { $$('#pageControlsInner .checkbox').invoke('observe', 'click', function() { Views.invalidate(); - ShowView(kronolithView, { date: kronolithDate.getFullYear() + (kronolithDate.getMonth() + 1).toPaddedString(2) + kronolithDate.getDate().toPaddedString(2), toggle_calendar: this.value }, false); + ShowView(KronolithView, { date: KronolithDate.getFullYear() + (KronolithDate.getMonth() + 1).toPaddedString(2) + KronolithDate.getDate().toPaddedString(2), toggle_calendar: this.value }, false); }); $$('#pageControlsInner .calendar-info').invoke('observe', 'click', function() { diff --git a/kronolith/js/edit.js b/kronolith/js/edit.js index b9e02f62d..1d8f971d6 100644 --- a/kronolith/js/edit.js +++ b/kronolith/js/edit.js @@ -520,6 +520,8 @@ var KronolithEdit = $('eventform').observe('click', this.clickHandler.bindAsEventListener(this)); $('eventform').observe('change', this.changeHandler.bindAsEventListener(this)); $('eventform').observe('keypress', this.keypressHandler.bindAsEventListener(this)); + + $('title').focus(); } }; diff --git a/kronolith/js/goto.js b/kronolith/js/goto.js index 3684169ef..48b54cbe4 100644 --- a/kronolith/js/goto.js +++ b/kronolith/js/goto.js @@ -50,7 +50,7 @@ var KronolithGoto = onDomLoad: function() { $('menu').down('A.kgotomenu').observe('click', function(e) { - Horde_Calendar.open(e.element(), Object.isUndefined(window.kronolithDate) ? new Date() : window.kronolithDate); + Horde_Calendar.open(e.element(), Object.isUndefined(window.KronolithDate) ? new Date() : window.KronolithDate); }); } diff --git a/kronolith/js/views.js b/kronolith/js/views.js index d55b3d3fb..90521aae8 100644 --- a/kronolith/js/views.js +++ b/kronolith/js/views.js @@ -90,8 +90,8 @@ function _ShowView() var viewVars = $('view_vars'); if (viewVars) { - kronolithView = viewVars.readAttribute('view'); - kronolithDate = new Date(viewVars.readAttribute('date')); + KronolithView = viewVars.readAttribute('view'); + KronolithDate = new Date(viewVars.readAttribute('date')); } } diff --git a/kronolith/templates/common-header.inc b/kronolith/templates/common-header.inc index f78aa19fa..c763729a5 100644 --- a/kronolith/templates/common-header.inc +++ b/kronolith/templates/common-header.inc @@ -30,13 +30,7 @@ $bc = (isset($view) && is_object($view) && $prefs->getValue('show_panel')) ? 'rightPanel' : ''; -$currentDate = Kronolith::currentDate(); - ?> - <?php echo htmlspecialchars($page_title) ?> diff --git a/kronolith/templates/edit/edit.inc b/kronolith/templates/edit/edit.inc index cc47d4372..ca88d161d 100644 --- a/kronolith/templates/edit/edit.inc +++ b/kronolith/templates/edit/edit.inc @@ -446,6 +446,3 @@ if ($event->alarm) { - diff --git a/kronolith/templates/javascript_defs.php b/kronolith/templates/javascript_defs.php index c6a6552c6..07ad9e6c2 100644 --- a/kronolith/templates/javascript_defs.php +++ b/kronolith/templates/javascript_defs.php @@ -4,6 +4,7 @@ */ $charset = $GLOBALS['registry']->getCharset(); +$currentDate = Kronolith::currentDate(); /* Variables used in core javascript files. */ $var = array( @@ -23,6 +24,8 @@ $gettext = array( ?> -- 2.11.0