diff options
| author | fisharebest <fisharebest@gmail.com> | 2012-06-16 21:57:04 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2012-06-16 21:57:04 +0000 |
| commit | 626f69d705ee67055cbb43a8483376d3878a56cc (patch) | |
| tree | 4cf83776770fe3adf6d2939ca1275910e7c77f8a /modules_v3 | |
| parent | 5f659efe6919fa45701f84ed0038a137c88f0c63 (diff) | |
| download | webtrees-626f69d705ee67055cbb43a8483376d3878a56cc.tar.gz webtrees-626f69d705ee67055cbb43a8483376d3878a56cc.tar.bz2 webtrees-626f69d705ee67055cbb43a8483376d3878a56cc.zip | |
Defer loading of external javascript (and most inline javascript) to the bottom of the page. This improves responsiveness, as the page can be rendered before the scripts are parsed.
Diffstat (limited to 'modules_v3')
39 files changed, 107 insertions, 145 deletions
diff --git a/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php b/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php index f7e05e2452..97969e5f7a 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_1_ctrl.php @@ -55,13 +55,13 @@ $wholename = $fulln; $currpid=$pid; -echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/dynamicoptionlist.js" type="text/javascript"></script>'; -echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/date.js" type="text/javascript"></script>'; +echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/dynamicoptionlist.js"></script>'; +echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/date.js"></script>'; -echo WT_JS_START; -echo "var TheCenYear = opener.document.getElementById('setyear').value;"; -echo "var TheCenCtry = opener.document.getElementById('setctry').value;"; -echo WT_JS_END; +echo '<script>'; +echo 'var TheCenYear = opener.document.getElementById("setyear").value;'; +echo 'var TheCenCtry = opener.document.getElementById("setctry").value;'; +echo '</script>'; // Header of assistant window ===================================================== echo '<div class="cens_header">'; @@ -108,6 +108,4 @@ echo '</div>'; echo '</div>'; ?> </div> -<script type="text/javascript"> - window.onLoad = initDynamicOptionLists(); -</script> +<script>window.onLoad = initDynamicOptionLists();</script> diff --git a/modules_v3/GEDFact_assistant/_CENS/census_2_source_input.php b/modules_v3/GEDFact_assistant/_CENS/census_2_source_input.php index 04706124a6..a65f0eaa38 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_2_source_input.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_2_source_input.php @@ -965,7 +965,7 @@ if (!defined('WT_WEBTREES')) { <option id="USOPT" name="USOPT" value="USA">USA</option> </select> - <script type="text/javascript"> + <script> if (TheCenYear=='') { var censyear = new DynamicOptionList(); censyear.addDependentFields("censCtry","censYear"); @@ -1027,7 +1027,7 @@ if (!defined('WT_WEBTREES')) { <div class="cens_sour_scs"> <div class="cens_sour_1"> <div class="cens_sour_2"><?php echo WT_I18N::translate('Title'); ?></div> - <script type="text/javascript"> + <script> document.writeln('<input id="Titl" name="Titl" type="text" value="<?php echo WT_I18N::translate('Census transcript'),' - ',$wholename, ' - ', WT_I18N::translate('Household'); ?>">'); </script> </div> diff --git a/modules_v3/GEDFact_assistant/_CENS/census_3_find.php b/modules_v3/GEDFact_assistant/_CENS/census_3_find.php index 4e670dba80..21e2d65ccf 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_3_find.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_3_find.php @@ -127,16 +127,14 @@ case "specialchar": $action="filter"; break; case "facts": - $controller->setPageTitle(WT_I18N::translate('Find a fact or event')); - echo - WT_JS_START, - 'jQuery(document).ready(function(){ initPickFact(); });', - WT_JS_END; + $controller + ->setPageTitle(WT_I18N::translate('Find a fact or event')) + ->addInlineJavascript('initPickFact();'); break; } $controller->pageHeader(); -echo WT_JS_START; +echo '<script>'; ?> function pasterow(id, nam, mnam, label, gend, cond, dom, dob, dod, occu, age, birthpl, fbirthpl, mbirthpl, chilBLD) { @@ -180,8 +178,8 @@ echo WT_JS_START; } return true; } +</script> <?php -echo WT_JS_END; $options = array(); $options["option"][]= "findindi"; @@ -431,7 +429,7 @@ if ($type == "facts") { echo "<tr><td class=\"list_label\" style=\"padding: 5px; font-weight: normal; white-space: normal;\">"; getPreselectedTags($preselDefault, $preselCustom); ?> - <?php echo WT_JS_START; ?> + <script> // A class representing a default tag function DefaultTag(id, name, selected) { this.Id=id; @@ -570,7 +568,7 @@ if ($type == "facts") { window.close(); return false; } - <?php echo WT_JS_END; ?> + </script> <div id="layDefinedTags"><table id="tabDefinedTags"> <thead><tr> <th> </th> @@ -1029,4 +1027,4 @@ if ($action=="filter") { echo "</div>"; // Close div that centers table // Set focus to the input field -if ($type!='facts') echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END; +if ($type!='facts') echo '<script>document.filter', $type, '.filter.focus();</script>'; diff --git a/modules_v3/GEDFact_assistant/_CENS/census_asst_help.php b/modules_v3/GEDFact_assistant/_CENS/census_asst_help.php index 6e6b5a5168..1128327148 100644 --- a/modules_v3/GEDFact_assistant/_CENS/census_asst_help.php +++ b/modules_v3/GEDFact_assistant/_CENS/census_asst_help.php @@ -2,9 +2,8 @@ <html <?php echo WT_I18N::html_markup(); ?>> <head> <title>Help window</title> -<script type="text/javascript"> +<script> /* - <!-- function printToPage() { var pos; @@ -16,7 +15,6 @@ } return(htmlOutput); } - //--> */ </script> </head> @@ -26,10 +24,8 @@ <br><br> Here will be the help for the Census Assistant window: <p> -<script type="text/javascript"> -<!-- +<script> document.write(printToPage()); -//--> </script> </p> </body> diff --git a/modules_v3/GEDFact_assistant/_CENS/js/census_5_input.js.php b/modules_v3/GEDFact_assistant/_CENS/js/census_5_input.js.php index 56176cfeaf..0509ea679e 100644 --- a/modules_v3/GEDFact_assistant/_CENS/js/census_5_input.js.php +++ b/modules_v3/GEDFact_assistant/_CENS/js/census_5_input.js.php @@ -4,7 +4,7 @@ // Census information about an individual // // webtrees: Web based Family History software -// Copyright (C) 2011 webtrees development team. +// Copyright (C) 2012 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved. @@ -31,7 +31,7 @@ // CONFIG notes. Below are some comments that point to where this script can be customized. // Note: Make sure to include a <tbody></tbody> in your table's HTML -echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/chapman_codes.js" type="text/javascript"></script>'; +echo '<script src="', WT_STATIC_URL, WT_MODULES_DIR, 'GEDFact_assistant/_CENS/js/chapman_codes.js"></script>'; ?> <script> diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php index a023cef36d..729122fbca 100644 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php +++ b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php @@ -33,7 +33,7 @@ $exist_links = safe_REQUEST($_REQUEST, 'exist_links', WT_REGEX_UNSAFE); $gid = safe_GET_xref('gid'); $update_CHAN = safe_REQUEST($_REQUEST, 'preserve_last_changed', WT_REGEX_UNSAFE); -$controller->addExternalJavaScript('js/autocomplete.js'); +$controller->addExternalJavascript('js/autocomplete.js'); $paramok = true; if (!empty($linktoid)) $paramok = WT_GedcomRecord::getInstance($linktoid)->canDisplayDetails(); @@ -41,8 +41,7 @@ if (!empty($linktoid)) $paramok = WT_GedcomRecord::getInstance($linktoid)->canDi if ($action == 'choose' && $paramok) { ?> - <script type="text/javascript"> - <!-- + <script> // Javascript variables var id_empty = "<?php echo WT_I18N::translate('When adding a Link, the ID field cannot be empty.'); ?>"; @@ -71,7 +70,6 @@ if ($action == 'choose' && $paramok) { } var GEDFact_assist = 'installed'; -//--> </script> <link href ="<?php echo WT_STATIC_URL, WT_MODULES_DIR; ?>GEDFact_assistant/css/media_0_inverselink.css" rel="stylesheet" type="text/css" media="screen"> @@ -198,7 +196,7 @@ if ($action == 'choose' && $paramok) { echo '<br><br>'; echo '<input type="hidden" name="idName" id="idName" size="36" value="Name of ID">'; ?> -<script type="text/javascript"> +<script> function addlinks(iname) { // iid=document.getElementById('gid').value; @@ -234,8 +232,8 @@ if ($action == 'choose' && $paramok) { <?php -// Various JavaScript variables required --------------------------------- ?> -<script type="text/javascript"> +// Various Javascript variables required --------------------------------- ?> +<script> var ifamily = "<?php echo WT_I18N::translate('Open Family Navigator'); ?>"; var remove = "<?php echo WT_I18N::translate('Remove'); ?>"; var linkExists = "<?php echo WT_I18N::translate('This link already exists'); ?>"; diff --git a/modules_v3/GEDFact_assistant/module.php b/modules_v3/GEDFact_assistant/module.php index a5a11f5569..88e8517257 100644 --- a/modules_v3/GEDFact_assistant/module.php +++ b/modules_v3/GEDFact_assistant/module.php @@ -154,7 +154,7 @@ class GEDFact_assistant_WT_Module extends WT_Module { } $controller->pageHeader(); - echo WT_JS_START; + echo '<script>'; ?> function pasterow(id, name, gend, yob, age, bpl) { @@ -199,7 +199,7 @@ class GEDFact_assistant_WT_Module extends WT_Module { return true; } <?php - echo WT_JS_END; + echo '</script>'; $options = array(); $options["option"][]= "findindi"; @@ -784,7 +784,7 @@ class GEDFact_assistant_WT_Module extends WT_Module { echo "</div>"; // Close div that centers table // Set focus to the input field - echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END; + echo '<script>document.filter', $type, '.filter.focus();</script>'; } private static function media_query_3a() { @@ -805,7 +805,7 @@ class GEDFact_assistant_WT_Module extends WT_Module { } } ?> - <script type="text/javascript"> + '<script>' function insertId() { if (window.opener.document.getElementById('addlinkQueue')) { // alert('Please move this alert window and examine the contents of the pop-up window, then click OK') @@ -813,23 +813,21 @@ class GEDFact_assistant_WT_Module extends WT_Module { window.close(); } } - </script> + '</script>' <?php } else { ?> - <script type="text/javascript"> + '<sccript>' function insertId() { window.opener.alert('<?php echo strtoupper($iid2); ?> - <?php echo WT_I18N::translate('Not a valid Individual, Family or Source ID'); ?>'); window.close(); } - </script> + '</script>' <?php } ?> - <script type="text/javascript"> - window.onLoad = insertId(); - </script> + '<script>'window.onLoad = insertId();'</script>' <?php } } diff --git a/modules_v3/batch_update/admin_batch_update.php b/modules_v3/batch_update/admin_batch_update.php index ef5abc1031..77a56aff4c 100644 --- a/modules_v3/batch_update/admin_batch_update.php +++ b/modules_v3/batch_update/admin_batch_update.php @@ -2,7 +2,7 @@ // Batch update module // // webtrees: Web based Family History software -// Copyright (C) 2011 webtrees development team. +// Copyright (C) 2012 webtrees development team. // // Derived from PhpGedView // Copyright (C) 2008 PGV Development Team. All rights reserved. @@ -91,7 +91,7 @@ class batch_update { if (substr($this->action, -4)=='_all') { // Reset - otherwise we might "undo all changes", which refreshes the // page, which makes them all again! - $html.='<script type="text/javascript">reset_reload();</script>'; + $html.='<script>reset_reload();</script>'; } else { if ($this->curr_xref) { // Create an object, so we can get the latest version of the name. @@ -290,7 +290,7 @@ class batch_update { // Javascript that gets included on every page static function getJavascript() { return - '<script type="text/javascript">'. + '<script>'. 'function reset_reload() {'. ' var bu_form=document.getElementById("batch_update_form");'. ' bu_form.xref.value="";'. diff --git a/modules_v3/charts/module.php b/modules_v3/charts/module.php index ce31034507..42a5a7c5b7 100644 --- a/modules_v3/charts/module.php +++ b/modules_v3/charts/module.php @@ -133,20 +133,16 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { $content .= "</td>"; } if ($type=='treenav') { - // TODO: we should - // 1) check whether the block is active - // 2) find out why it is necessary to load jquery, when it is already loaded require_once WT_MODULES_DIR.'tree/module.php'; require_once WT_MODULES_DIR.'tree/class_treeview.php'; $mod=new tree_WT_Module; $tv=new TreeView; $content .= '<td>'; - $content .= '<script src="'.WT_JQUERY_URL.'"></script><script type="text/javascript" src="'.WT_JQUERYUI_URL.'"></script>'; $content .= '<script>$("head").append(\'<link rel="stylesheet" href="'.$mod->css().'" type="text/css" />\');</script>'; $content .= '<script src="'.$mod->js().'"></script>'; list($html, $js) = $tv->drawViewport($person->getXref(), 2); - $content .= $html.WT_JS_START.$js.WT_JS_END; + $content .= $html.'<script>'.$js.'</script>'; $content .= '</td>'; } $content .= "</tr></table>"; @@ -195,7 +191,6 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'details', safe_POST_bool('details')); set_block_setting($block_id, 'type', safe_POST('type', array('pedigree', 'descendants', 'hourglass', 'treenav'), 'pedigree')); set_block_setting($block_id, 'pid', safe_POST('pid', WT_REGEX_XREF)); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } @@ -203,7 +198,7 @@ class charts_WT_Module extends WT_Module implements WT_Module_Block { $type =get_block_setting($block_id, 'type', 'pedigree'); $pid =get_block_setting($block_id, 'pid', WT_USER_ID ? (WT_USER_GEDCOM_ID ? WT_USER_GEDCOM_ID : $PEDIGREE_ROOT_ID) : $PEDIGREE_ROOT_ID); - $controller->addExternalJavaScript('js/autocomplete.js'); + $controller->addExternalJavascript('js/autocomplete.js'); ?> <tr><td class="descriptionbox wrap width33"><?php echo WT_I18N::translate('Chart type'); ?></td> <td class="optionbox"> diff --git a/modules_v3/clippings/module.php b/modules_v3/clippings/module.php index 504e0e4638..0df9ff3480 100644 --- a/modules_v3/clippings/module.php +++ b/modules_v3/clippings/module.php @@ -64,11 +64,11 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module $controller ->setPageTitle($this->getTitle()) ->PageHeader() - ->addExternalJavaScript('js/autocomplete.js');; + ->addExternalJavascript('js/autocomplete.js'); - echo WT_JS_START; + echo '<script>'; echo 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;}'; - echo WT_JS_END; + echo '</script>'; if (!$WT_SESSION->cart[WT_GED_ID]) { echo '<h2>', WT_I18N::translate('Family Tree Clippings Cart'), '</h2>'; @@ -144,10 +144,10 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module echo WT_I18N::translate('The Clippings Cart allows you to take extracts ("clippings") from this family tree and bundle them up into a single file for downloading and subsequent importing into your own genealogy program. The downloadable file is recorded in GEDCOM format.<br /><ul><li>How to take clippings?<br />This is really simple. Whenever you see a clickable name (individual, family, or source) you can go to the Details page of that name. There you will see the <b>Add to Clippings Cart</b> option. When you click that link you will be offered several options to download.</li><li>How to download?<br />Once you have items in your cart, you can download them just by clicking the <b>Download Now</b> link. Follow the instructions and links.</li></ul>'); - echo WT_JS_START; + echo '<script>'; echo 'var pastefield;'; echo 'function paste_id(value) {pastefield.value=value;}'; - echo WT_JS_END; + echo '</script>'; ?> <form method="get" name="addin" action="module.php"> <input type="hidden" name="mod" value="clippings"> @@ -235,14 +235,12 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module </table> <br> - <script type="text/javascript"> - <!-- + <script> var pastefield; function paste_id(value) { pastefield.value=value; } - //--> </script> <form method="get" name="addin" action="module.php"> <input type="hidden" name="mod" value="clippings"> @@ -359,18 +357,16 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module // Impelement WT_Module_Sidebar public function getSidebarContent() { - return - WT_JS_START.' - jQuery(document).ready(function() { + global $controller; + + $controller->addInlineJavascript(' jQuery(".add_cart, .remove_cart").live("click", function() { jQuery("#sb_clippings_content").load(this.href); return false; }); - });'. - WT_JS_END. - '<div id="sb_clippings_content">'. - $this->getCartList(). - '</div>'; + '); + + return '<div id="sb_clippings_content">' . $this->getCartList() . '</div>'; } // Impelement WT_Module_Sidebar @@ -493,14 +489,14 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module public function askAddOptions($person) { global $MAX_PEDIGREE_GENERATIONS; $out = '<h3><a href="'.$person->getHtmlUrl().'">'.$person->getFullName().'</a></h3>'; - $out .= WT_JS_START; + $out .= '<script>'; $out .= 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;} function continueAjax(frm) { var others = jQuery("input[name=\'others\']:checked").val(); var link = "module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&add1="+frm.pid.value+"&others="+others+"&level1="+frm.level1.value+"&level2="+frm.level2.value+"&level3="+frm.level3.value; jQuery("#sb_clippings_content").load(link); }'; - $out .= WT_JS_END; + $out .= '</script>'; if ($person->getType()=='FAM') { $out .= '<form action="module.php" method="get" onsubmit="continueAjax(this); return false;"> @@ -562,12 +558,12 @@ class clippings_WT_Module extends WT_Module implements WT_Module_Menu, WT_Module public function downloadForm($clip_ctrl) { $pid=safe_GET_xref('pid'); - $out = WT_JS_START; + $out = '<script>'; $out .= 'function cancelDownload() { var link = "module.php?mod='.$this->getName().'&mod_action=ajax&sb_action=clippings&pid='.$pid.'"; jQuery("#sb_clippings_content").load(link); }'; - $out .= WT_JS_END; + $out .= '</script>'; $out .= '<form method="get" action="module.php"> <input type="hidden" name="mod" value="clippings"> <input type="hidden" name="mod_action" value="index"> diff --git a/modules_v3/descendancy/module.php b/modules_v3/descendancy/module.php index b9f41b711e..04a66e7dc2 100644 --- a/modules_v3/descendancy/module.php +++ b/modules_v3/descendancy/module.php @@ -85,7 +85,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { public function getSidebarContent() { global $controller; - $controller->addInlineJavaScript(' + $controller->addInlineJavascript(' var dloadedNames = new Array(); function dsearchQ() { @@ -151,7 +151,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $out .= $this->loadSpouses($person->getXref()); $out .= '</div>'; $base_controller=new WT_Controller_Base(); - $base_controller->addInlineJavaScript('dloadedNames["'.$person->getXref().'"]=2;'); + $base_controller->addInlineJavascript('dloadedNames["'.$person->getXref().'"]=2;'); } else { $out .= '<div class="desc_tree_div">'; $out .= '</div>'; @@ -175,7 +175,7 @@ class descendancy_WT_Module extends WT_Module implements WT_Module_Sidebar { $out .= $this->loadChildren($family->getXref(), $generations); $out .= '</div>'; $base_controller=new WT_Controller_Base(); - $base_controller->addInlineJavaScript('dloadedNames["'.$family->getXref().'"]=2;'); + $base_controller->addInlineJavascript('dloadedNames["'.$family->getXref().'"]=2;'); $out .= '</li>'; return $out; } diff --git a/modules_v3/families/module.php b/modules_v3/families/module.php index 5d89218014..460290cc0f 100644 --- a/modules_v3/families/module.php +++ b/modules_v3/families/module.php @@ -91,7 +91,7 @@ class families_WT_Module extends WT_Module implements WT_Module_Sidebar { // Fetch a list of the initial letters of all surnames in the database $initials=WT_Query_Name::surnameAlpha(true, false, WT_GED_ID); - $controller->addInlineJavaScript(' + $controller->addInlineJavascript(' var famloadedNames = new Array(); function fsearchQ() { diff --git a/modules_v3/gedcom_favorites/module.php b/modules_v3/gedcom_favorites/module.php index f9b595d8cc..43c75b7fc2 100644 --- a/modules_v3/gedcom_favorites/module.php +++ b/modules_v3/gedcom_favorites/module.php @@ -113,7 +113,8 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { $title=$this->getTitle(); if (WT_USER_ID) { - $controller->addExternalJavaScript('js/autocomplete.js'); + $controller + ->addExternalJavascript('js/autocomplete.js'); } $content = ''; @@ -168,7 +169,7 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { } if ($ctype=='user' || WT_USER_GEDCOM_ADMIN) { $uniqueID = floor(microtime() * 1000000); // This block can theoretically appear multiple times, so use a unique ID. - $content .= WT_JS_START.'var pastefield; function paste_id(value) {pastefield.value=value;}'.WT_JS_END; + $content .= '<script>var pastefield; function paste_id(value) {pastefield.value=value;}</script>'; $content .= '<div class="add_fav_head">'; $content .= '<a href="#" onclick="return expand_layer(\'add_fav'.$uniqueID.'\');">'.WT_I18N::translate('Add a new favorite').'<i id="add_fav'.$uniqueID.'_img" class="icon-plus"></i></a>'; $content .= '</div>'; @@ -233,7 +234,6 @@ class gedcom_favorites_WT_Module extends WT_Module implements WT_Module_Block { public function configureBlock($block_id) { if (safe_POST_bool('save')) { set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/gedcom_news/module.php b/modules_v3/gedcom_news/module.php index 3f038cf9a0..bea19df02e 100644 --- a/modules_v3/gedcom_news/module.php +++ b/modules_v3/gedcom_news/module.php @@ -162,7 +162,6 @@ class gedcom_news_WT_Module extends WT_Module implements WT_Module_Block { if (safe_POST_bool('save')) { set_block_setting($block_id, 'limit', safe_POST('limit')); set_block_setting($block_id, 'flag', safe_POST('flag')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/gedcom_stats/module.php b/modules_v3/gedcom_stats/module.php index a4259b2b7e..3dfeedd2a7 100644 --- a/modules_v3/gedcom_stats/module.php +++ b/modules_v3/gedcom_stats/module.php @@ -251,7 +251,6 @@ class gedcom_stats_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'stat_most_chil', safe_POST_bool('stat_most_chil')); set_block_setting($block_id, 'stat_avg_chil', safe_POST_bool('stat_avg_chil')); set_block_setting($block_id, 'stat_link', safe_POST_bool('stat_link')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/googlemap/module.php b/modules_v3/googlemap/module.php index a830f0791d..c0a6f29355 100644 --- a/modules_v3/googlemap/module.php +++ b/modules_v3/googlemap/module.php @@ -200,7 +200,7 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu ->requireAdminLogin() ->setPageTitle(WT_I18N::translate('Google Maps™')) ->pageHeader() - ->addInlineJavaScript('jQuery("#tabs").tabs();'); + ->addInlineJavascript('jQuery("#tabs").tabs();'); if ($action=='update') { @@ -707,11 +707,8 @@ class googlemap_WT_Module extends WT_Module implements WT_Module_Config, WT_Modu $controller ->setPageTitle(/* I18N: %s is a person's name */ WT_I18N::translate('Pedigree map of %s', $controller->getPersonName())) ->pageHeader() - ->addExternalJavaScript('js/autocomplete.js') - ->addInLineJavaScript('var pastefield; - function paste_id(value) { - pastefield.value=value; - }'); + ->addExternalJavascript('js/autocomplete.js') + ->addInLineJavascript('var pastefield; function paste_id(value) {pastefield.value=value;}'); echo '<link type="text/css" href ="', WT_STATIC_URL, WT_MODULES_DIR, 'googlemap/css/wt_v3_googlemap.css" rel="stylesheet">'; echo '<div><table><tr><td valign="middle">'; diff --git a/modules_v3/googlemap/placehierarchy.php b/modules_v3/googlemap/placehierarchy.php index 83dcf73778..b3e94d0e74 100644 --- a/modules_v3/googlemap/placehierarchy.php +++ b/modules_v3/googlemap/placehierarchy.php @@ -187,7 +187,7 @@ function create_map($placelevels) { echo '<td style="margin-left:15px; float:right; ">'; if ($STREETVIEW) { - $controller->addInlineJavaScript(' + $controller->addInlineJavascript(' function update_sv_params(placeid) { var svlati = document.getElementById("sv_latiText").value.slice(0, -1); var svlong = document.getElementById("sv_longText").value.slice(0, -1); @@ -461,7 +461,7 @@ function print_gm_markers($place2, $level, $parent, $levelm, $linklevels, $place function map_scripts($numfound, $level, $parent, $linklevels, $placelevels, $place_names) { global $GOOGLEMAP_MAP_TYPE, $GOOGLEMAP_PH_WHEEL, $GOOGLEMAP_PH_CONTROLS, $GOOGLEMAP_PH_MARKER, $plzoom, $controller; - $controller->addInlineJavaScript(' + $controller->addInlineJavascript(' jQuery("head").append(\'<link rel="stylesheet" type="text/css" href="'.WT_STATIC_URL.WT_MODULES_DIR.'googlemap/css/wt_v3_googlemap.css" />\'); var numMarkers = "'.$numfound.'"; var mapLevel = "'.$level. '"; @@ -589,14 +589,14 @@ function map_scripts($numfound, $level, $parent, $linklevels, $placelevels, $pla $numls = count($parent)-1; $levelo=check_were_am_i($numls, $levelm); if ($numfound<2 && ($level==1 || !(isset($levelo[($level-1)])))) { - $controller->addInlineJavaScript('map.maxZoom=6;'); + $controller->addInlineJavascript('map.maxZoom=6;'); // echo "zoomlevel = map.getBoundsZoomLevel(bounds);\n"; // echo " map.setCenter(new google.maps.LatLng(0, 0), zoomlevel+5);\n"; } else if ($numfound<2 && !isset($levelo[($level-2)])) { // echo "zoomlevel = map.getBoundsZoomLevel(bounds);\n"; // echo " map.setCenter(new google.maps.LatLng(0, 0), zoomlevel+6);\n"; } else if ($level==2) { - $controller->addInlineJavaScript('map.maxZoom=10'); + $controller->addInlineJavascript('map.maxZoom=10'); // echo "zoomlevel = map.getBoundsZoomLevel(bounds);\n"; // echo " map.setCenter(new google.maps.LatLng(0, 0), zoomlevel+8);\n"; } else if ($numfound<2 && $level>1) { @@ -662,5 +662,5 @@ function map_scripts($numfound, $level, $parent, $linklevels, $placelevels, $pla print_gm_markers($place, $level, $parent, $place['place_id'], $linklevels, $placelevels); } } - $controller->addInlineJavaScript(ob_get_clean()); + $controller->addInlineJavascript(ob_get_clean()); } diff --git a/modules_v3/googlemap/util.js b/modules_v3/googlemap/util.js index 0e642fd6c0..cccd5da88f 100644 --- a/modules_v3/googlemap/util.js +++ b/modules_v3/googlemap/util.js @@ -74,7 +74,7 @@ function xmlParse(str) { } /** - * Appends a JavaScript file to the page. + * Appends a Javascript file to the page. * @param {string} url */ function downloadScript(url) { diff --git a/modules_v3/html/module.php b/modules_v3/html/module.php index 8ccdfeeace..1ce0f79a5c 100644 --- a/modules_v3/html/module.php +++ b/modules_v3/html/module.php @@ -150,7 +150,6 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { } } set_block_setting($block_id, 'languages', implode(',', $languages)); -// echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } @@ -279,12 +278,12 @@ class html_WT_Module extends WT_Module implements WT_Module_Block { '</td><td class="optionbox">' ; if (array_key_exists('ckeditor', WT_Module::getActiveModules())) { - echo WT_JS_START, + echo '<script>', 'function loadTemplate(html) {', ' var oEditor = CKEDITOR.instances["html"];', ' oEditor.setData(html);', '}', - WT_JS_END, + '</script>', '<select name="template" onchange="loadTemplate(document.block.template.options[document.block.template.selectedIndex].value);">'; } else { echo '<select name="template" onchange="document.block.html.value=document.block.template.options[document.block.template.selectedIndex].value;">'; diff --git a/modules_v3/individuals/module.php b/modules_v3/individuals/module.php index d72a316d80..58b45c855f 100644 --- a/modules_v3/individuals/module.php +++ b/modules_v3/individuals/module.php @@ -91,7 +91,7 @@ class individuals_WT_Module extends WT_Module implements WT_Module_Sidebar { // Fetch a list of the initial letters of all surnames in the database $initials=WT_Query_Name::surnameAlpha(true, false, WT_GED_ID); - $controller->addInlineJavaScript(' + $controller->addInlineJavascript(' var loadedNames = new Array(); function isearchQ() { diff --git a/modules_v3/lightbox/module.php b/modules_v3/lightbox/module.php index e61fd3c4a6..01cab26e02 100644 --- a/modules_v3/lightbox/module.php +++ b/modules_v3/lightbox/module.php @@ -123,7 +123,7 @@ class lightbox_WT_Module extends WT_Module implements WT_Module_Config, WT_Modul document.getElementById("ord2").value = order; }); };'; - $controller->addInlineJavaScript($js); + $controller->addInlineJavascript($js); $html.='<form name="reorder_form" method="post" action="edit_interface.php"> <input type="hidden" name="action" value="al_reorder_media_update"> <input type="hidden" name="pid" value="'.$controller->record->getXref().'"> @@ -208,15 +208,15 @@ class lightbox_WT_Module extends WT_Module implements WT_Module_Config, WT_Modul } $js.='var CB_SlShowTime = "'.get_module_setting('lightbox', 'LB_SS_SPEED', '6').'"; // Slide show timer var CB_Animation = "'.get_module_setting('lightbox', 'LB_TRANSITION', 'warp').'";'; // Next/Prev Image transition effect - $controller->addInlineJavaScript($js) - ->addExternalJavaScript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/Sound.js') - ->addExternalJavaScript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/clearbox.js') - ->addExternalJavaScript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/wz_tooltip.js') - ->addExternalJavaScript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/tip_centerwindow.js'); + $controller->addInlineJavascript($js) + ->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/Sound.js') + ->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/clearbox.js') + ->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/wz_tooltip.js') + ->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/tip_centerwindow.js'); if ($TEXT_DIRECTION=='ltr') { - $controller->addExternalJavaScript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/tip_balloon.js'); + $controller->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/tip_balloon.js'); } else { - $controller->addExternalJavaScript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/tip_balloon_RTL.js'); + $controller->addExternalJavascript(WT_STATIC_URL.WT_MODULES_DIR.$this->getName().'/js/tip_balloon_RTL.js'); } return true; } diff --git a/modules_v3/login_block/module.php b/modules_v3/login_block/module.php index 56c3604d9b..e8798d377e 100644 --- a/modules_v3/login_block/module.php +++ b/modules_v3/login_block/module.php @@ -44,7 +44,7 @@ class login_block_WT_Module extends WT_Module implements WT_Module_Block { global $controller; $id=$this->getName().$block_id; $class=$this->getName().'_block'; - $controller->addInlineJavaScript(' + $controller->addInlineJavascript(' jQuery("#new_passwd").hide(); jQuery("#passwd_click").click(function() { jQuery("#new_passwd").slideToggle(100, function() { diff --git a/modules_v3/notes/module.php b/modules_v3/notes/module.php index e93a876ea5..a4a25bb6ec 100644 --- a/modules_v3/notes/module.php +++ b/modules_v3/notes/module.php @@ -109,7 +109,7 @@ class notes_WT_Module extends WT_Module implements WT_Module_Tab { <br> <?php if (!$SHOW_LEVEL2_NOTES) { - echo WT_JS_START, 'jQuery("tr.row_note2").toggle();', WT_JS_END; + echo '<script>jQuery("tr.row_note2").toggle();</script>'; } return '<div id="'.$this->getName().'_content">'.ob_get_clean().'</div>'; } diff --git a/modules_v3/personal_facts/module.php b/modules_v3/personal_facts/module.php index cbbe905a1f..7fa5039f75 100644 --- a/modules_v3/personal_facts/module.php +++ b/modules_v3/personal_facts/module.php @@ -54,14 +54,14 @@ class personal_facts_WT_Module extends WT_Module implements WT_Module_Tab { global $EXPAND_RELATIVES_EVENTS, $controller; $EXPAND_HISTO_EVENTS = false; - echo WT_JS_START; + echo '<script>'; if (!$EXPAND_RELATIVES_EVENTS) { echo "jQuery('tr.row_rela').toggle();"; } if (!$EXPAND_HISTO_EVENTS) { echo "jQuery('tr.row_histo').toggle();"; } - echo WT_JS_END; + echo '</script>'; //-- only need to add family facts on this tab if (!isset($controller->skipFamilyFacts)) { diff --git a/modules_v3/random_media/module.php b/modules_v3/random_media/module.php index 6991a8b53d..3537410631 100644 --- a/modules_v3/random_media/module.php +++ b/modules_v3/random_media/module.php @@ -199,7 +199,7 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { if ($TEXT_DIRECTION=="rtl") $content .= $linkNextImage; $content .= "<a href=\"#\" onclick=\"togglePlay(); return false;\" id=\"play_stop\" class=\"".$icon_class."\" title=\"".WT_I18N::translate('Play')."/".WT_I18N::translate('Stop').'"></a>'; if ($TEXT_DIRECTION=="ltr") $content .= $linkNextImage; - $content .= '</div>'.WT_JS_START.' + $content .= '</div><script> var play = false; function togglePlay() { if (play) { @@ -223,10 +223,10 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { jQuery("#block_'.$block_id.'").load("index.php?ctype='.$ctype.'&action=ajax&block_id='.$block_id.'&start=1"); } } - '.WT_JS_END; + </script>'; } if ($start) { - $content .= WT_JS_START.'togglePlay();'.WT_JS_END; + $content .= '<script>togglePlay();</script>'; } $content .= '<div class="center" id="random_picture_content'.$block_id.'">'; $content .= '<table id="random_picture_box"><tr><td'; @@ -307,7 +307,6 @@ class random_media_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'filter_photo', safe_POST_bool('filter_photo')); set_block_setting($block_id, 'filter_tombstone', safe_POST_bool('filter_tombstone')); set_block_setting($block_id, 'filter_video', safe_POST_bool('filter_video')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/recent_changes/module.php b/modules_v3/recent_changes/module.php index 4de18cdf7c..e9bb4c8056 100644 --- a/modules_v3/recent_changes/module.php +++ b/modules_v3/recent_changes/module.php @@ -126,7 +126,6 @@ class recent_changes_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'sortStyle', safe_POST('sortStyle', array('name', 'date_asc', 'date_desc'), 'date_desc')); set_block_setting($block_id, 'hide_empty', safe_POST_bool('hide_empty')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/relatives/module.php b/modules_v3/relatives/module.php index 82dbf62c6c..406e1d672f 100644 --- a/modules_v3/relatives/module.php +++ b/modules_v3/relatives/module.php @@ -409,7 +409,7 @@ class relatives_WT_Module extends WT_Module implements WT_Module_Tab { } if (!$SHOW_AGE_DIFF) { - echo WT_JS_START, "jQuery('DIV.elderdate').toggle();", WT_JS_END; + echo '<script>jQuery("DIV.elderdate").toggle();</script>'; } if ($controller->record->canEdit()) { diff --git a/modules_v3/review_changes/module.php b/modules_v3/review_changes/module.php index 2532322694..58e1cd450e 100644 --- a/modules_v3/review_changes/module.php +++ b/modules_v3/review_changes/module.php @@ -168,7 +168,6 @@ class review_changes_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'days', safe_POST_integer('num', 1, 180, 7)); set_block_setting($block_id, 'sendmail', safe_POST_bool('sendmail')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/sources_tab/module.php b/modules_v3/sources_tab/module.php index c767029d38..32ff994ac2 100644 --- a/modules_v3/sources_tab/module.php +++ b/modules_v3/sources_tab/module.php @@ -89,7 +89,7 @@ class sources_tab_WT_Module extends WT_Module implements WT_Module_Tab { <br> <?php if (!$SHOW_LEVEL2_NOTES) { - echo WT_JS_START, 'jQuery("tr.row_sour2").toggle();', WT_JS_END; + echo '<script>jQuery("tr.row_sour2").toggle();</script>'; } return '<div id="'.$this->getName().'_content">'.ob_get_clean().'</div>'; } diff --git a/modules_v3/stories/module.php b/modules_v3/stories/module.php index 1cbbb2e4e1..c2faba3b8d 100644 --- a/modules_v3/stories/module.php +++ b/modules_v3/stories/module.php @@ -226,9 +226,9 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_ } $controller ->pageHeader() - ->addExternalJavaScript('js/autocomplete.js') + ->addExternalJavascript('js/autocomplete.js') // for the findindi link - ->addInlineJavaScript('var pastefield;function paste_id(value){pastefield.value=value;}'); + ->addInlineJavascript('var pastefield;function paste_id(value){pastefield.value=value;}'); // "Help for this page" link echo '<div id="page_help">', help_link('add_story', $this->getName()), '</div>'; @@ -319,8 +319,8 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_ $controller->setPageTitle($this->getTitle()); $controller->pageHeader(); $controller - ->addExternalJavaScript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') - ->addInlineJavaScript(' + ->addExternalJavascript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') + ->addInlineJavascript(' jQuery("#story_table").dataTable({ "sDom": \'<"H"pf<"dt-clear">irl>t<"F"pl>\', "bAutoWidth":false, @@ -390,8 +390,8 @@ class stories_WT_Module extends WT_Module implements WT_Module_Block, WT_Module_ $controller->setPageTitle($this->getTitle()); $controller->pageHeader(); $controller - ->addExternalJavaScript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') - ->addInlineJavaScript(' + ->addExternalJavascript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') + ->addInlineJavascript(' jQuery("#story_table").dataTable({ "sDom": \'<"H"pf<"dt-clear">irl>t<"F"pl>\', "bAutoWidth":false, diff --git a/modules_v3/todays_events/module.php b/modules_v3/todays_events/module.php index e928bb8506..ed3dc2ebf6 100644 --- a/modules_v3/todays_events/module.php +++ b/modules_v3/todays_events/module.php @@ -117,7 +117,6 @@ class todays_events_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'table'), 'table')); set_block_setting($block_id, 'sortStyle', safe_POST('sortStyle', array('alpha', 'anniv'), 'alpha')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/todo/module.php b/modules_v3/todo/module.php index 58aa64846c..529855d48c 100644 --- a/modules_v3/todo/module.php +++ b/modules_v3/todo/module.php @@ -66,8 +66,8 @@ class todo_WT_Module extends WT_Module implements WT_Module_Block { $table_id = 'ID'.floor(microtime()*1000000); // create a unique ID $controller - ->addExternalJavaScript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') - ->addInlineJavaScript(' + ->addExternalJavascript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') + ->addInlineJavascript(' jQuery("#'.$table_id.'").dataTable( { "sDom": \'t\', '.WT_I18N::datatablesI18N().', @@ -164,7 +164,6 @@ class todo_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'show_unassigned', safe_POST_bool('show_unassigned')); set_block_setting($block_id, 'show_future', safe_POST_bool('show_future')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/top10_givnnames/module.php b/modules_v3/top10_givnnames/module.php index 5f2f4546b9..2831fcd5a3 100644 --- a/modules_v3/top10_givnnames/module.php +++ b/modules_v3/top10_givnnames/module.php @@ -132,7 +132,6 @@ class top10_givnnames_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'num', safe_POST_integer('num', 1, 10000, 10)); set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'table'), 'table')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/top10_pageviews/module.php b/modules_v3/top10_pageviews/module.php index 3ca67654cc..5992f3fe7d 100644 --- a/modules_v3/top10_pageviews/module.php +++ b/modules_v3/top10_pageviews/module.php @@ -126,7 +126,6 @@ class top10_pageviews_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'num', safe_POST_integer('num', 1, 10000, 10)); set_block_setting($block_id, 'count_placement', safe_POST('count_placement', array('before', 'after'), 'before')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } require_once WT_ROOT.'includes/functions/functions_edit.php'; diff --git a/modules_v3/top10_surnames/module.php b/modules_v3/top10_surnames/module.php index d7fe307ad1..3c47682bfd 100644 --- a/modules_v3/top10_surnames/module.php +++ b/modules_v3/top10_surnames/module.php @@ -145,7 +145,6 @@ class top10_surnames_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'num', safe_POST_integer('num', 1, 10000, 10)); set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'array', 'table', 'tagcloud'), 'table')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/tree/module.php b/modules_v3/tree/module.php index c212dbddd2..c0a6fc5a3c 100644 --- a/modules_v3/tree/module.php +++ b/modules_v3/tree/module.php @@ -58,16 +58,16 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab { $tv = new TreeView('tvTab'); list($html, $js) = $tv->drawViewport($controller->record->getXref(), 3); return - '<script type="text/javascript" src="'.$this->js().'"></script>'. + '<script src="'.$this->js().'"></script>'. $html. - WT_JS_START.' + '<script> if (document.createStyleSheet) { document.createStyleSheet("'.$this->css().'"); // For Internet Explorer } else { jQuery("head").append(\'<link rel="stylesheet" type="text/css" href="'.$this->css().'">\'); }'. $js. - WT_JS_END; + '</script>'; } // Implement WT_Module_Tab @@ -109,9 +109,9 @@ class tree_WT_Module extends WT_Module implements WT_Module_Tab { $controller ->setPageTitle(WT_I18N::translate('Interactive tree of %s', $person->getFullName())) ->pageHeader() - ->addExternalJavaScript($this->js()) - ->addInlineJavaScript($js) - ->addInlineJavaScript(' + ->addExternalJavascript($this->js()) + ->addInlineJavascript($js) + ->addInlineJavascript(' if (document.createStyleSheet) { document.createStyleSheet("'.$this->css().'"); // For Internet Explorer } else { diff --git a/modules_v3/upcoming_events/module.php b/modules_v3/upcoming_events/module.php index 1b0e741abb..d896abc9cb 100644 --- a/modules_v3/upcoming_events/module.php +++ b/modules_v3/upcoming_events/module.php @@ -121,7 +121,6 @@ class upcoming_events_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'table'), 'table')); set_block_setting($block_id, 'sortStyle', safe_POST('sortStyle', array('alpha', 'anniv'), 'alpha')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/user_messages/module.php b/modules_v3/user_messages/module.php index cd642fe649..8cc74f7116 100644 --- a/modules_v3/user_messages/module.php +++ b/modules_v3/user_messages/module.php @@ -153,7 +153,6 @@ class user_messages_WT_Module extends WT_Module implements WT_Module_Block { public function configureBlock($block_id) { if (safe_POST_bool('save')) { set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } diff --git a/modules_v3/yahrzeit/module.php b/modules_v3/yahrzeit/module.php index 83103176a5..02679c91c0 100644 --- a/modules_v3/yahrzeit/module.php +++ b/modules_v3/yahrzeit/module.php @@ -121,8 +121,8 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { default: $table_id = "ID".floor(microtime()*1000000); // table requires a unique ID $controller - ->addExternalJavaScript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') - ->addInlineJavaScript(' + ->addExternalJavascript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') + ->addInlineJavascript(' jQuery("#'.$table_id.'").dataTable({ "sDom": \'t\', '.WT_I18N::datatablesI18N().', @@ -229,7 +229,6 @@ class yahrzeit_WT_Module extends WT_Module implements WT_Module_Block { set_block_setting($block_id, 'days', safe_POST_integer('days', 1, 30, 7)); set_block_setting($block_id, 'infoStyle', safe_POST('infoStyle', array('list', 'table'), 'table')); set_block_setting($block_id, 'block', safe_POST_bool('block')); - echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } |
