From 2a0c35ce910d5f159586b3e74c497f250965f268 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 3 Sep 2010 16:02:42 -0600 Subject: [PATCH] No need to add prototype.js if at least 1 other script file is added --- ansel/lib/View/Image.php | 1 - framework/Core/lib/Horde.php | 3 +++ framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php | 1 - framework/Core/lib/Horde/Core/Tree/Javascript.php | 1 - framework/Core/lib/Horde/Core/Ui/VarRenderer/Html.php | 1 - framework/Form/Form/Action/reload.php | 1 - framework/Form/Form/Action/submit.php | 1 - horde/services/sidebar.php | 1 - jonah/channels/index.php | 1 - mnemo/list.php | 1 - mnemo/notes/index.php | 1 - shout/admin.php | 1 - shout/admin/accounts.php | 1 - shout/admin/numbers.php | 1 - shout/dialplan.php | 1 - shout/extensions.php | 1 - shout/recordings.php | 1 - shout/wizard.php | 1 - trean/browse.php | 1 - trean/templates/star_rating_helper.php | 1 - whups/lib/Forms/Action.php | 1 - whups/lib/View/Results.php | 1 - 22 files changed, 3 insertions(+), 21 deletions(-) diff --git a/ansel/lib/View/Image.php b/ansel/lib/View/Image.php index bf32207b6..157e44d34 100644 --- a/ansel/lib/View/Image.php +++ b/ansel/lib/View/Image.php @@ -375,7 +375,6 @@ class Ansel_View_Image extends Ansel_View_Base /* Output the js if we are calling via the api */ if (!empty($this->_params['api'])) { $includes = $GLOBALS['injector']->createInstance('Horde_Script_Files'); - $includes->add('prototype.js', 'horde', true, true); $includes->add('effects.js', 'horde',true, true); $includes->add('stripe.js', 'horde', true, true); $includes->includeFiles(); diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 87e4e05ef..2519b0a57 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -174,6 +174,9 @@ HTML; * Adds the javascript code to the output (if output has already started) * or to the list of script files to include via includeScriptFiles(). * + * As long as one script file is added, 'prototype.js' will be + * automatically added. + * * @param string $file The full javascript file name. * @param string $app The application name. Defaults to the current * application. diff --git a/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php b/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php index b8177c798..baab9abe1 100644 --- a/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php +++ b/framework/Core/lib/Horde/Core/Ajax/Imple/SpellChecker.php @@ -57,7 +57,6 @@ class Horde_Core_Ajax_Imple_SpellChecker extends Horde_Core_Ajax_Imple */ public function attach() { - Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('effects.js', 'horde'); Horde::addScriptFile('keynavlist.js', 'horde'); Horde::addScriptFile('spellchecker.js', 'horde'); diff --git a/framework/Core/lib/Horde/Core/Tree/Javascript.php b/framework/Core/lib/Horde/Core/Tree/Javascript.php index 18e385604..b65d9b3e7 100644 --- a/framework/Core/lib/Horde/Core/Tree/Javascript.php +++ b/framework/Core/lib/Horde/Core/Tree/Javascript.php @@ -30,7 +30,6 @@ class Horde_Core_Tree_Javascript extends Horde_Core_Tree_Html { parent::__construct($name, $params); - Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('hordetree.js', 'horde'); /* Check for a javascript session state. */ diff --git a/framework/Core/lib/Horde/Core/Ui/VarRenderer/Html.php b/framework/Core/lib/Horde/Core/Ui/VarRenderer/Html.php index a1ddd3e57..89e7703d6 100644 --- a/framework/Core/lib/Horde/Core/Ui/VarRenderer/Html.php +++ b/framework/Core/lib/Horde/Core/Ui/VarRenderer/Html.php @@ -575,7 +575,6 @@ class Horde_Core_Ui_VarRenderer_Html extends Horde_Core_Ui_VarRenderer . ' value="' . @htmlspecialchars($color, ENT_QUOTES, $this->_charset) . '" />'; if ($browser->hasFeature('javascript')) { - Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('colorpicker.js', 'horde'); $html .= '' . Horde::link('#', _("Color Picker"), '', '', diff --git a/framework/Form/Form/Action/reload.php b/framework/Form/Form/Action/reload.php index f5c40714f..0434b38e4 100644 --- a/framework/Form/Form/Action/reload.php +++ b/framework/Form/Form/Action/reload.php @@ -18,7 +18,6 @@ class Horde_Form_Action_reload extends Horde_Form_Action { function getActionScript($form, $renderer, $varname) { - Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('effects.js', 'horde'); Horde::addScriptFile('redbox.js', 'horde'); return 'if (this.value) { document.' . $form->getName() . '.formname.value=\'\'; RedBox.loading(); document.' . $form->getName() . '.submit() }'; diff --git a/framework/Form/Form/Action/submit.php b/framework/Form/Form/Action/submit.php index efaa1f6e0..c8170aa5f 100644 --- a/framework/Form/Form/Action/submit.php +++ b/framework/Form/Form/Action/submit.php @@ -18,7 +18,6 @@ class Horde_Form_Action_submit extends Horde_Form_Action { function getActionScript($form, $renderer, $varname) { - Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('effects.js', 'horde'); Horde::addScriptFile('redbox.js', 'horde'); return 'RedBox.loading(); document.' . $form->getName() . '.submit()'; diff --git a/horde/services/sidebar.php b/horde/services/sidebar.php index 5cbdbc9a3..09ffc90d5 100644 --- a/horde/services/sidebar.php +++ b/horde/services/sidebar.php @@ -26,7 +26,6 @@ if (!Horde_Util::getFormData('ajaxui') && ($registry->getAuth() && $prefs->getValue('show_sidebar')))) { $tree = $injector->getInstance('Horde_Core_Sidebar')->getTree(); - Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('sidebar.js', 'horde'); $ajax_url = Horde::getServiceLink('ajax', 'horde'); diff --git a/jonah/channels/index.php b/jonah/channels/index.php index 1fec386f6..7e573cede 100644 --- a/jonah/channels/index.php +++ b/jonah/channels/index.php @@ -92,7 +92,6 @@ $GLOBALS['notification']->notify(array('listeners' => 'status')); $template->set('notify', Horde::endBuffer()); $title = _("Feeds"); -Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('tables.js', 'horde', true); Horde::addScriptFile('quickfinder.js', 'horde', true); require JONAH_TEMPLATES . '/common-header.inc'; diff --git a/mnemo/list.php b/mnemo/list.php index 559cfba2f..084b55c63 100644 --- a/mnemo/list.php +++ b/mnemo/list.php @@ -55,7 +55,6 @@ case 'search_memos': } Horde::addScriptFile('tables.js', 'horde', true); -Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('quickfinder.js', 'horde', true); require MNEMO_TEMPLATES . '/common-header.inc'; require MNEMO_TEMPLATES . '/menu.inc'; diff --git a/mnemo/notes/index.php b/mnemo/notes/index.php index 5202808a2..7e0721ee8 100644 --- a/mnemo/notes/index.php +++ b/mnemo/notes/index.php @@ -39,7 +39,6 @@ $title = _("Search Results"); $memos = $search_results; Horde::addScriptFile('tables.js', 'horde', true); -Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('quickfinder.js', 'horde', true); require MNEMO_TEMPLATES . '/common-header.inc'; diff --git a/shout/admin.php b/shout/admin.php index 9e59bde1d..9d7e866bd 100644 --- a/shout/admin.php +++ b/shout/admin.php @@ -22,7 +22,6 @@ $RENDERER = new Horde_Form_Renderer(); $title = _("Accounts: "); Horde::addScriptFile('stripe.js', 'horde'); -Horde::addScriptFile('prototype.js', 'horde'); require SHOUT_TEMPLATES . '/common-header.inc'; require SHOUT_TEMPLATES . '/menu.inc'; diff --git a/shout/admin/accounts.php b/shout/admin/accounts.php index 8cddbd399..45f486930 100644 --- a/shout/admin/accounts.php +++ b/shout/admin/accounts.php @@ -98,7 +98,6 @@ try { } Horde::addScriptFile('stripe.js', 'horde'); -Horde::addScriptFile('prototype.js', 'horde'); require SHOUT_TEMPLATES . '/common-header.inc'; require SHOUT_TEMPLATES . '/menu.inc'; diff --git a/shout/admin/numbers.php b/shout/admin/numbers.php index 482654de1..7bf341d83 100644 --- a/shout/admin/numbers.php +++ b/shout/admin/numbers.php @@ -97,7 +97,6 @@ try { } Horde::addScriptFile('stripe.js', 'horde'); -Horde::addScriptFile('prototype.js', 'horde'); require SHOUT_TEMPLATES . '/common-header.inc'; require SHOUT_TEMPLATES . '/menu.inc'; diff --git a/shout/dialplan.php b/shout/dialplan.php index 46213795c..966971314 100644 --- a/shout/dialplan.php +++ b/shout/dialplan.php @@ -84,7 +84,6 @@ if ($action == 'edit') { } Horde::addScriptFile('stripe.js', 'horde'); -Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('scriptaculous.js', 'horde'); require SHOUT_TEMPLATES . '/common-header.inc'; diff --git a/shout/extensions.php b/shout/extensions.php index e9b3acf1e..1080c24cd 100644 --- a/shout/extensions.php +++ b/shout/extensions.php @@ -31,7 +31,6 @@ try { } Horde::addScriptFile('stripe.js', 'horde'); -Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('scriptaculous.js', 'horde'); require SHOUT_TEMPLATES . '/common-header.inc'; diff --git a/shout/recordings.php b/shout/recordings.php index a3516a0f7..a2d67949f 100644 --- a/shout/recordings.php +++ b/shout/recordings.php @@ -52,7 +52,6 @@ default: } Horde::addScriptFile('stripe.js', 'horde'); -Horde::addScriptFile('prototype.js', 'horde'); require SHOUT_TEMPLATES . '/common-header.inc'; require SHOUT_TEMPLATES . '/menu.inc'; diff --git a/shout/wizard.php b/shout/wizard.php index 4999801b9..f6ba96539 100644 --- a/shout/wizard.php +++ b/shout/wizard.php @@ -64,7 +64,6 @@ try { $notification->push($e); } -Horde::addScriptFile('prototype.js', 'horde'); Horde::addScriptFile('scriptaculous.js', 'horde'); Horde::addScriptFile('stripe.js', 'horde'); diff --git a/trean/browse.php b/trean/browse.php index 1bddbaf58..750353686 100644 --- a/trean/browse.php +++ b/trean/browse.php @@ -54,7 +54,6 @@ if (!empty($folder)) { } Horde::addScriptFile('tables.js', 'horde', true); -Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('effects.js', 'horde', true); Horde::addScriptFile('redbox.js', 'horde', true); $title = _("Browse"); diff --git a/trean/templates/star_rating_helper.php b/trean/templates/star_rating_helper.php index 5d0dfc5e0..56972a00b 100644 --- a/trean/templates/star_rating_helper.php +++ b/trean/templates/star_rating_helper.php @@ -2,7 +2,6 @@ // Here we should tell the view using this helper to include the // relevant CSS and JavaScript. Currently CSS is in the main Trean CSS // file. -Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('star_rating.js', 'trean', true); // Eventual class var. diff --git a/whups/lib/Forms/Action.php b/whups/lib/Forms/Action.php index 1416b31bc..30e48bfea 100644 --- a/whups/lib/Forms/Action.php +++ b/whups/lib/Forms/Action.php @@ -22,7 +22,6 @@ class Horde_Form_Action_whups_reload extends Horde_Form_Action { function getActionScript($form, $renderer, $varname) { - Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('effects.js', 'horde', true); Horde::addScriptFile('redbox.js', 'horde', true); return 'if (this.value) { document.' . $form->getName() diff --git a/whups/lib/View/Results.php b/whups/lib/View/Results.php index c998912f7..de456aa14 100755 --- a/whups/lib/View/Results.php +++ b/whups/lib/View/Results.php @@ -21,7 +21,6 @@ class Whups_View_Results extends Whups_View { function html() { - Horde::addScriptFile('prototype.js', 'horde', true); Horde::addScriptFile('tables.js', 'horde', true); global $prefs, $registry; -- 2.11.0