Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Remove inline Javascript for administrator/components/com_joomlaupda…
Browse files Browse the repository at this point in the history
…te/tmpl/joomlaupdate/default.php (#101)

* updater1

* use script options

* corrections

* corrections

* corrections
  • Loading branch information
astridx authored and dneukirchen committed Mar 9, 2018
1 parent 28f2ab0 commit cae0d8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN');

$latestJoomlaVersion = $this->updateInfo['latest'];

JFactory::getDocument()->addScriptDeclaration(
<<<JS
var joomlaTargetVersion = '$latestJoomlaVersion';
JS
);

?>

<div id="joomlaupdate-wrapper">
<div id="joomlaupdate-wrapper" data-joomla-target-version="<?php echo $latestJoomlaVersion; ?>">
<?php if ($this->showUploadAndUpdate) : ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'joomlaupdate-tabs', array('active' => $this->shouldDisplayPreUpdateCheck() ? 'pre-update-check' : 'online-update')); ?>
<?php if ($this->shouldDisplayPreUpdateCheck()) : ?>
Expand Down
2 changes: 1 addition & 1 deletion media/com_joomlaupdate/js/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Joomla = window.Joomla || {};
*/
PreUpdateChecker.run = function () {
// Get version of the available joomla update
PreUpdateChecker.joomlaTargetVersion = window.joomlaTargetVersion;
PreUpdateChecker.joomlaTargetVersion = document.getElementById('joomlaupdate-wrapper').getAttribute('data-joomla-target-version');

// Grab all extensions based on the selector set in the config object
var $extensions = $(PreUpdateChecker.config.selector);
Expand Down

0 comments on commit cae0d8d

Please sign in to comment.