Skip to content

Commit

Permalink
morrrrre
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed May 31, 2017
1 parent d38061a commit e70bd5e
Show file tree
Hide file tree
Showing 9 changed files with 729 additions and 117 deletions.
2 changes: 1 addition & 1 deletion installation/controller/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function execute()
$this->getInput()->set('view', $defaultView);
}

if ($tmpModel->getOptions())
if (!$tmpModel->getPhpOptionsSufficient())
{
if ($vName !== 'preinstall')
{
Expand Down
2 changes: 1 addition & 1 deletion installation/model/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function getPhpOptions()

$option = new stdClass;
$option->label = JText::sprintf('INSTL_WRITABLE', 'configuration.php');
$option->state = false; //$writable;
$option->state = $writable;
$option->notice = $option->state ? null : JText::_('INSTL_NOTICEYOUCANSTILLINSTALL');
$options[] = $option;

Expand Down
11 changes: 6 additions & 5 deletions installation/template/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -3269,10 +3269,8 @@ tbody.collapse.show {

@media (min-width: 576px) {
.card-columns {
-moz-column-count: 3;
column-count: 3;
-moz-column-gap: 1.25rem;
column-gap: 1.25rem; }
column-count: 3;
column-gap: 1.25rem; }
.card-columns .card {
display: inline-block;
width: 100%;
Expand Down Expand Up @@ -8867,4 +8865,7 @@ form {
.lang-select .custom-select {
height: 30px;
padding: .3rem 1.75rem .3rem .75rem;
line-height: 1; }
line-height: 1; }

.hidden {
display: none; }
2 changes: 1 addition & 1 deletion installation/template/css/template.css.map

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions installation/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
$this->setHtml5(true);

JHtml::_('behavior.core');
JHtml::_('jquery.framework');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

Expand Down Expand Up @@ -63,10 +64,6 @@
<form class="lang-select">
<label for="jform_language" class="control-label"><?php echo JText::_('INSTL_SELECT_LANGUAGE_TITLE'); ?></label>
<select id="jform_language" class="custom-select required ml-2">
<option selected>Choose...</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</form>

Expand Down
56 changes: 42 additions & 14 deletions installation/template/js/installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Joomla.installation = function(_container, _base) {
*/
install = function(tasks, step_width) {
var progressWrapper = document.getElementById('install_progress');
var $progress = $(progressWrapper).find('.progress-bar');
var $progress = jQuery(progressWrapper).find('.progress-bar');

if (!tasks.length) {
$progress.css('width', parseFloat($progress.get(0).style.width) + (step_width * 3) + '%');
Expand All @@ -214,8 +214,8 @@ Joomla.installation = function(_container, _base) {
}

var task = tasks.shift();
var $form = $('#adminForm');
var $tr = $('#install_' + task);
var $form = jQuery('#adminForm');
var $tr = jQuery('#install_' + task);
var data = $form.serialize();

$progress.css('width', parseFloat($progress.get(0).style.width) + step_width + '%');
Expand Down Expand Up @@ -264,10 +264,10 @@ Joomla.installation = function(_container, _base) {
* @param el The page element requesting the event
*/
detectFtpRoot = function(el) {
var $el = $(el), data = $el.closest('form').serialize();
var $el = jQuery(el), data = $el.closest('form').serialize();

$el.attr('disabled', 'disabled');

var task = 'detectftproot';
Joomla.request({
type: "POST",
url : baseUrl + '?task=Install' + task + '&layout=default',
Expand All @@ -279,7 +279,7 @@ Joomla.installation = function(_container, _base) {
if (r) {
Joomla.replaceTokens(r.token)
if (r.error == false) {
$('#jform_ftp_root').val(r.data.root);
jQuery('#jform_ftp_root').val(r.data.root);
} else {
alert(r.message);
}
Expand All @@ -305,8 +305,8 @@ Joomla.installation = function(_container, _base) {
*/
verifyFtpSettings = function(el) {
// make the ajax call
var $el = $(el), data = $el.closest('form').serialize();

var $el = jQuery(el), data = $el.closest('form').serialize();
console.log(data)
$el.attr('disabled', 'disabled');

Joomla.request({
Expand Down Expand Up @@ -345,7 +345,7 @@ Joomla.installation = function(_container, _base) {
* @param el The page element requesting the event
*/
removeFolder = function(el) {
var $el = $(el), $languages = $("#languages"), $defaultError = $('#theDefaultError'), $defualtErrorMessage = $('#theDefaultErrorMessage'), data = 'format: json&' + $el.closest('form').serialize();
var $el = jQuery(el), $languages = jQuery("#languages"), $defaultError = jQuery('#theDefaultError'), $defualtErrorMessage = jQuery('#theDefaultErrorMessage'), data = 'format: json&' + $el.closest('form').serialize();

if ($languages.length) {
$languages.fadeOut();
Expand Down Expand Up @@ -388,8 +388,8 @@ Joomla.installation = function(_container, _base) {
try {
var r = $.parseJSON(xhr.responseText);
Joomla.replaceTokens(r.token);
$('#theDefaultError').show();
$('#theDefaultErrorMessage').html(r.message);
jQuery('#theDefaultError').show();
jQuery('#theDefaultErrorMessage').html(r.message);
} catch (e) {
}
$el.removeAttr('disabled');
Expand All @@ -398,8 +398,8 @@ Joomla.installation = function(_container, _base) {
},

toggle = function(id, el, value) {
var val = $('input[name="jform[' + el + ']"]:checked').val(),
$id = $('#' + id);
var val = jQuery('input[name="jform[' + el + ']"]:checked').val(),
$id = jQuery('#' + id);
if (val === value.toString()) {
$id.show();
} else {
Expand Down Expand Up @@ -505,8 +505,29 @@ Joomla.installation = function(_container, _base) {
// Init on dom content loaded event
document.addEventListener('DOMContentLoaded', function() {

document.getElementById('container-installation').classList.remove('no-js');
// Show the container
if (document.getElementById('container-installation')) {
document.getElementById('container-installation').classList.remove('no-js');
} else {
throw new Error('WTF?')
}

// We don't match the base requirements
if (document.getElementById('prerequisites')) {
console.log(document.getElementById('prerequisites'))
console.log(document.getElementById('showFtp'))
console.log(document.getElementById('prerequisites'))
if (document.getElementById('showFtp')) {
document.getElementById('showFtp').addEventListener('click', function(e) {
e.preventDefault();
if (document.getElementById('ftpOptions').classList.contains('hidden')) {
document.getElementById('ftpOptions').classList.remove('hidden')
} else {
document.getElementById('ftpOptions').classList.add('hidden')
}
})
}
}

// Init the elements
// initElements();
Expand All @@ -527,6 +548,13 @@ document.addEventListener('DOMContentLoaded', function() {
// The language used
language: "",

// FTP
ftpUsername: "",
ftpPassword: "",
ftpHost: "",
ftpPort: 21,
ftpRoot: "/",

// Admin
adminName: "",
// adminPassword: "",
Expand Down

0 comments on commit e70bd5e

Please sign in to comment.