From 9bd7df72b9c23df59d20208537266a2f718ba666 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 3 Sep 2010 15:56:23 -0600 Subject: [PATCH] Tooltips tweaks. Automatically add JS file when calling linkTooltip(). Move tooltips JS file to horde/Core. --- agora/lib/Messages.php | 3 --- {horde => framework/Core}/js/tooltips.js | 0 framework/Core/lib/Horde.php | 2 ++ framework/Core/package.xml | 2 ++ imp/mailbox.php | 4 +--- ingo/filters.php | 1 - kronolith/lib/Block/month.php | 2 -- kronolith/year.php | 1 - mnemo/list.php | 1 - mnemo/notes/index.php | 1 - 10 files changed, 5 insertions(+), 12 deletions(-) rename {horde => framework/Core}/js/tooltips.js (100%) diff --git a/agora/lib/Messages.php b/agora/lib/Messages.php index a62620eaf..2214fce94 100644 --- a/agora/lib/Messages.php +++ b/agora/lib/Messages.php @@ -1652,9 +1652,6 @@ class Agora_Messages { return $files; } - /* Make sure we have the tooltips javascript. */ - Horde::addScriptFile('tooltips.js', 'horde', true); - /* Constuct the link with a tooltip for further info on the download. */ $html = '
'; $view_url = Horde::url('view.php'); diff --git a/horde/js/tooltips.js b/framework/Core/js/tooltips.js similarity index 100% rename from horde/js/tooltips.js rename to framework/Core/js/tooltips.js diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 2c69ade51..87e4e05ef 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -1178,6 +1178,8 @@ HTML; $old_error = error_reporting(0); $title = '<pre>' . preg_replace(array('/\n/', '/((?))/em', '/

/', '/
/'), array('', 'str_repeat(" ", strlen("$1"))', '<br /> <br />', '<br />'), nl2br(htmlspecialchars(htmlspecialchars($title, ENT_QUOTES, $charset), ENT_QUOTES, $charset))) . '</pre>'; error_reporting($old_error); + + Horde::addScriptFile('tooltips.js', 'horde'); } return self::link($url, $title, $class, $target, $onclick, null, $accesskey, $attributes, false); diff --git a/framework/Core/package.xml b/framework/Core/package.xml index ba2b3e823..6ba9af0f7 100644 --- a/framework/Core/package.xml +++ b/framework/Core/package.xml @@ -68,6 +68,7 @@ Application Framework. + @@ -409,6 +410,7 @@ Application Framework. + diff --git a/imp/mailbox.php b/imp/mailbox.php index 2479ba943..5a346cb39 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -304,9 +304,7 @@ $sort_url = $mailbox_imp_url->copy()->add('sortdir', ($sortpref['dir']) ? 0 : 1) $preview_tooltip = $show_preview ? $prefs->getValue('preview_show_tooltip') : false; -if ($preview_tooltip) { - Horde::addScriptFile('tooltips.js', 'horde'); -} else { +if (!$preview_tooltip) { $strip_preview = $prefs->getValue('preview_strip_nl'); } diff --git a/ingo/filters.php b/ingo/filters.php index 6cbb4444c..ac9dd7f05 100644 --- a/ingo/filters.php +++ b/ingo/filters.php @@ -133,7 +133,6 @@ case 'apply_filters': /* Get the list of rules now. */ $filter_list = $filters->getFilterList(); -Horde::addScriptFile('tooltips.js', 'horde'); Horde::addScriptFile('stripe.js', 'horde'); Horde::addScriptFile('filters.js', 'ingo'); Ingo::prepareMenu(); diff --git a/kronolith/lib/Block/month.php b/kronolith/lib/Block/month.php index 9365d8c85..112ca1928 100644 --- a/kronolith/lib/Block/month.php +++ b/kronolith/lib/Block/month.php @@ -70,8 +70,6 @@ class Horde_Block_Kronolith_month extends Horde_Block } } - Horde::addScriptFile('tooltips.js', 'horde'); - $year = date('Y'); $month = date('m'); $startday = new Horde_Date(array('mday' => 1, diff --git a/kronolith/year.php b/kronolith/year.php index 92a3ea9e5..a1fc159f4 100644 --- a/kronolith/year.php +++ b/kronolith/year.php @@ -20,7 +20,6 @@ if (Kronolith::showAjaxView()) { $view = Kronolith::getView('Year'); $title = $view->year; -Horde::addScriptFile('tooltips.js', 'horde'); require KRONOLITH_TEMPLATES . '/common-header.inc'; require KRONOLITH_TEMPLATES . '/menu.inc'; diff --git a/mnemo/list.php b/mnemo/list.php index b315aa65d..559cfba2f 100644 --- a/mnemo/list.php +++ b/mnemo/list.php @@ -54,7 +54,6 @@ case 'search_memos': break; } -Horde::addScriptFile('tooltips.js', 'horde', true); Horde::addScriptFile('tables.js', 'horde', true); Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('quickfinder.js', 'horde', true); diff --git a/mnemo/notes/index.php b/mnemo/notes/index.php index 44173e753..5202808a2 100644 --- a/mnemo/notes/index.php +++ b/mnemo/notes/index.php @@ -38,7 +38,6 @@ if (count($search_results) == 1) { $title = _("Search Results"); $memos = $search_results; -Horde::addScriptFile('tooltips.js', 'horde', true); Horde::addScriptFile('tables.js', 'horde', true); Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('quickfinder.js', 'horde', true); -- 2.11.0