/* Add the site specific javascript now. */
if (!empty($site_menu)) {
foreach ($site_menu as $key => $menu_item) {
- if ($menu_item == 'separator') {
- continue;
+ if ($menu_item != 'separator') {
+ foreach (array('menu', 'tab') as $val) {
+ $js_code[] = 'DimpCore.clickObserveHandler({ d: $(\'' . $val . $key . '\'), f: function() { ' . $menu_item['action'] . ' } })';
+ }
}
- $js_code[] = 'DimpCore.clickObserveHandler({ d: $(\'menu' . $key . '\'), f: function() { ' . $menu_item['action'] . ' } })';
- $js_code[] = 'DimpCore.clickObserveHandler({ d: $(\'tab' . $key . '\'), f: function() { ' . $menu_item['action'] . ' } })';
}
}
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-var IMP = window.IMP || {};
-
-IMP.menuFolderSubmit = function(clear)
-{
- var mf = $('menuform');
-
- if ((!this.menufolder_load || clear) &&
- $F(mf.down('SELECT[name="mailbox"]'))) {
- this.menufolder_load = true;
- mf.submit();
+document.observe('dom:loaded', function() {
+ if (!window.IMP) {
+ window.IMP = {};
}
-};
-/**
- * Use DOM manipulation to un-block images.
- */
-IMP.unblockImages = function(e)
-{
- var elt = e.element().up('TABLE.mimeStatusMessage');
-
- elt.next('.htmlMessage').select('[blocked]').each(function(e) {
- var src = decodeURIComponent(e.readAttribute('blocked'));
- if (e.hasAttribute('src')) {
- e.writeAttribute('src', src);
- } else if (e.hasAttribute('background')) {
- e.writeAttribute('background', src);
- } else if (e.style.backgroundImage) {
- e.setStyle({ backgroundImage: 'url(' + src + ')' });
- }
- });
-
- Effect.Fade(elt, { duration: 0.6, afterFinish: function() { elt.remove(); } });
+ window.IMP.menuFolderSubmit = function(clear)
+ {
+ var mf = $('menuform');
- e.stop();
-};
+ if ((!this.menufolder_load || clear) &&
+ $F(mf.down('SELECT[name="mailbox"]'))) {
+ this.menufolder_load = true;
+ mf.submit();
+ }
+ };
+
+ /**
+ * Use DOM manipulation to un-block images.
+ */
+ window.IMP.unblockImages = function(e)
+ {
+ var elt = e.element().up('TABLE.mimeStatusMessage');
+
+ elt.next('.htmlMessage').select('[blocked]').each(function(e) {
+ var src = decodeURIComponent(e.readAttribute('blocked'));
+ if (e.hasAttribute('src')) {
+ e.writeAttribute('src', src);
+ } else if (e.hasAttribute('background')) {
+ e.writeAttribute('background', src);
+ } else if (e.style.backgroundImage) {
+ e.setStyle({ backgroundImage: 'url(' + src + ')' });
+ }
+ });
+
+ Effect.Fade(elt, {
+ afterFinish: function() { elt.remove(); },
+ duration: 0.6
+ });
+
+ e.stop();
+ };
-document.observe('dom:loaded', function() {
// If menu is present, attach event handlers to folder switcher.
var tmp = $('openfoldericon');
if (tmp) {
- $('menuform').observe('change', IMP.menuFolderSubmit.bind(IMP));
- tmp.down().observe('click', IMP.menuFolderSubmit.bind(IMP, true));
+ $('menuform').observe('change', window.IMP.menuFolderSubmit.bind(window.IMP));
+ tmp.down().observe('click', window.IMP.menuFolderSubmit.bind(window.IMP, true));
}
});
$imp_view = Horde_Util::nonInputVar('imp_view');
switch ($imp_view) {
case 'dimp':
- include IMP_TEMPLATES . '/javascript_defs_dimp.php';
-
$css = array();
if (!empty($GLOBALS['conf']['dimp']['css_files'])) {
foreach ($GLOBALS['conf']['css_files'] as $css_file) {
);
}
}
-
Horde::includeStylesheetFiles(array('additional' => $css, 'sub' => 'dimp'));
+ include IMP_TEMPLATES . '/javascript_defs_dimp.php';
break;
default:
- include IMP_TEMPLATES . '/javascript_defs.php';
- Horde::includeScriptFiles();
Horde::includeStylesheetFiles();
+ Horde::includeScriptFiles();
+ include IMP_TEMPLATES . '/javascript_defs.php';
break;
}
?>