case 'year':
case 'agenda':
case 'tasks':
+ this.closeView();
var locCap = loc.capitalize();
- [ 'Day', 'Week', 'Month', 'Year', 'Tasks', 'Agenda' ].each(function(a) {
- $('kronolithNav' + a).removeClassName('on');
- });
$('kronolithNav' + locCap).addClassName('on');
- if (this.view && this.view != loc) {
- $('kronolithView' + this.view.capitalize()).fade({ 'queue': 'end' });
- }
switch (loc) {
case 'day':
break;
case 'search':
- [ 'Day', 'Week', 'Month', 'Year', 'Tasks', 'Agenda' ].each(function(a) {
- $('kronolithNav' + a).removeClassName('on');
- });
- if (this.view) {
- $('kronolithView' + this.view.capitalize()).fade({ 'queue': 'end' });
- }
var cals = [], term = locParts[1],
query = Object.toJSON({ 'title': term });
+ this.closeView();
this.updateView(null, 'search', term);
$H(Kronolith.conf.calendars).each(function(type) {
$H(type.value).each(function(calendar) {
break;
case 'options':
- //this.highlightSidebar('appoptions');
- this._addHistory(loc);
- this.setTitle(Kronolith.text.prefs);
+ this.closeView();
this.iframeContent(loc, Kronolith.conf.prefs_url);
+ this.setTitle(Kronolith.text.prefs);
+ this._addHistory(loc);
break;
}
},
},
/**
+ * Closes the currently active view.
+ */
+ closeView: function()
+ {
+ [ 'Day', 'Week', 'Month', 'Year', 'Tasks', 'Agenda' ].each(function(a) {
+ $('kronolithNav' + a).removeClassName('on');
+ });
+ if (this.view) {
+ $('kronolithView' + this.view.capitalize()).fade({ 'queue': 'end' });
+ }
+ if ($('kronolithIframe').visible()) {
+ $('kronolithIframe').fade({ 'queue': 'end' });
+ }
+ },
+
+ /**
* Creates a single row of day cells for usage in the month and multi-week
* views.
*
name = loc;
}
- var container = $('dimpmain_portal'), iframe;
- if (!container) {
- this.showNotifications([ { type: 'horde.error', message: 'Bad portal!' } ]);
- return;
- }
-
- iframe = new Element('IFRAME', { id: 'iframe' + name, className: 'iframe', frameBorder: 0, src: loc });
- this._resizeIE6Iframe(iframe);
-
- // Hide menu in prefs pages.
- if (name == 'options') {
- iframe.observe('load', function() { $('iframeoptions').contentWindow.document.getElementById('menu').style.display = 'none'; });
+ if ($('kronolithIframe' + name)) {
+ $('kronolithIframe' + name).src = loc;
+ } else {
+ var iframe = new Element('IFRAME', { 'id': 'kronolithIframe' + name, 'class': 'kronolithIframe', 'frameBorder': 0, 'src': loc });
+ //this._resizeIE6Iframe(iframe);
+ $('kronolithIframe').insert(iframe);
}
- container.insert(iframe);
+ this.view = null;
+ $('kronolithIframe').appear({ 'queue': 'end' });
},
onResize: function(noupdate, nowait)
e.stop();
return;
+ case 'kronolithOptions':
+ this.go('options');
+ e.stop();
+ return;
+
case 'kronolithMinicalDate':
this.go('month:' + orig.retrieve('date'));
e.stop();
<!-- ini user zone -->
<div id="kronolithUser">
- <a href="#"><?php echo _("Options") ?></a><?php if ($help_link) echo ' <span class="kronolithSeparator">·</span> ' . $help_link; if ($logout_link) echo ' <span class="kronolithSeparator">·</span> ' . $logout_link ?><br />
+ <a href="#" id="kronolithOptions"><?php echo _("Options") ?></a><?php if ($help_link) echo ' <span class="kronolithSeparator">·</span> ' . $help_link; if ($logout_link) echo ' <span class="kronolithSeparator">·</span> ' . $logout_link ?><br />
<span class="kronolithUserName"><?php echo $identity->getName(); ?></span><br />
</div>
<!-- end user zone -->
<!-- ini bar -->
<div id="kronolithBar">
- <div class="kronolithDateChoice" title="<?php echo _("Today") ?>">
- <div><?php echo $today->format('l, j F Y') ?></div>
- </div>
+ <div class="kronolithDateChoice" title="<?php echo _("Today") ?>">
+ <div><?php echo $today->format('l, j F Y') ?></div>
+ </div>
<div id="kronolithNav">
<a id="kronolithNavDay"><?php echo _("Day") ?></a>
require dirname(__FILE__) . '/tasks.inc';
require dirname(__FILE__) . '/agenda.inc';
?>
+<div id="kronolithIframe" style="display:none"></div>
</div>
<!-- end body -->