Skip to content

Commit

Permalink
Fix indents
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Mar 27, 2017
1 parent 639e3a0 commit 58ccc98
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 142 deletions.
Expand Up @@ -44,24 +44,24 @@
var outerDiv = $("#installer-install");
JoomlaInstaller.getLoadingOverlay()
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", "0")
.css("width", "100%")
.css("height", "100%")
.css("display", "none")
.css("margin-top", "-10px");
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", "0")
.css("width", "100%")
.css("height", "100%")
.css("display", "none")
.css("margin-top", "-10px");
});
var JoomlaInstaller = {
getLoadingOverlay: function () {
return jQuery("#loading");
},
showLoading: function () {
this.getLoadingOverlay().css("display", "block");
},
hideLoading: function () {
this.getLoadingOverlay().css("display", "none");
}
getLoadingOverlay: function () {
return jQuery("#loading");
},
showLoading: function () {
this.getLoadingOverlay().css("display", "block");
},
hideLoading: function () {
this.getLoadingOverlay().css("display", "none");
}
};
'
);
Expand Down
254 changes: 127 additions & 127 deletions plugins/installer/packageinstaller/tmpl/default.php
Expand Up @@ -39,138 +39,138 @@
// Drag-drop installation
JFactory::getDocument()->addScriptDeclaration(
<<<JS
jQuery(document).ready(function($) {
var dragZone = $('body');
var tabContent = $('#package');
var cover = $('<div id="dragarea" style="display: none;"></div>');
var url = 'index.php?option=com_installer&task=install.ajax_upload';
var returnUrl = '{$return}';
if (returnUrl) {
url += '&return=' + returnUrl;
}
// Create drag cover first
dragZone.append(cover);
dragZone.on('dragenter', function(e) {
e.preventDefault();
e.stopPropagation();
if (!tabContent.hasClass('active')) {
return;
}
cover.fadeIn();
return false;
});
// Notify user when file is over the drop area
dragZone.on('dragover', function(e) {
e.preventDefault();
e.stopPropagation();
if (!tabContent.hasClass('active')) {
return;
}
cover.fadeIn();
return false;
});
cover.on('dragleave', function(e) {
e.preventDefault();
e.stopPropagation();
cover.fadeOut();
return false;
});
dragZone.on('drop', function(e) {
e.preventDefault();
e.stopPropagation();
if (!tabContent.hasClass('active')) {
return;
}
if (typeof FormData === 'undefined') {
Joomla.renderMessages({'error': [Joomla.JText._("COM_INSTALLER_DRAG_ERR_UNSUPPORTEDBROWSER")]});
return;
}
cover.fadeOut();
var files = e.originalEvent.target.files || e.originalEvent.dataTransfer.files;
if (!files.length) {
return;
}
var file = files[0];
var data = new FormData;
data.append('install_package', file);
data.append('installtype', 'upload');
data.append('{$token}', 1);
JoomlaInstaller.showLoading();
$.ajax({
url: url,
data: data,
type: 'post',
processData: false,
cache: false,
contentType: false
}).done(function (res) {
if (res.success) {
if (res.data.redirect) {
location.href = res.data.redirect;
} else {
location.href = 'index.php?option=com_installer&view=install';
}
} else {
JoomlaInstaller.hideLoading();
alert(res.message);
}
}).error (function (error) {
JoomlaInstaller.hideLoading();
alert(error.statusText);
});
});
});
jQuery(document).ready(function($) {
var dragZone = $('body');
var tabContent = $('#package');
var cover = $('<div id="dragarea" style="display: none;"></div>');
var url = 'index.php?option=com_installer&task=install.ajax_upload';
var returnUrl = '{$return}';
if (returnUrl) {
url += '&return=' + returnUrl;
}
// Create drag cover first
dragZone.append(cover);
dragZone.on('dragenter', function(e) {
e.preventDefault();
e.stopPropagation();
if (!tabContent.hasClass('active')) {
return;
}
cover.fadeIn();
return false;
});
// Notify user when file is over the drop area
dragZone.on('dragover', function(e) {
e.preventDefault();
e.stopPropagation();
if (!tabContent.hasClass('active')) {
return;
}
cover.fadeIn();
return false;
});
cover.on('dragleave', function(e) {
e.preventDefault();
e.stopPropagation();
cover.fadeOut();
return false;
});
dragZone.on('drop', function(e) {
e.preventDefault();
e.stopPropagation();
if (!tabContent.hasClass('active')) {
return;
}
if (typeof FormData === 'undefined') {
Joomla.renderMessages({'error': [Joomla.JText._("COM_INSTALLER_DRAG_ERR_UNSUPPORTEDBROWSER")]});
return;
}
cover.fadeOut();
var files = e.originalEvent.target.files || e.originalEvent.dataTransfer.files;
if (!files.length) {
return;
}
var file = files[0];
var data = new FormData;
data.append('install_package', file);
data.append('installtype', 'upload');
data.append('{$token}', 1);
JoomlaInstaller.showLoading();
$.ajax({
url: url,
data: data,
type: 'post',
processData: false,
cache: false,
contentType: false
}).done(function (res) {
if (res.success) {
if (res.data.redirect) {
location.href = res.data.redirect;
} else {
location.href = 'index.php?option=com_installer&view=install';
}
} else {
JoomlaInstaller.hideLoading();
alert(res.message);
}
}).error (function (error) {
JoomlaInstaller.hideLoading();
alert(error.statusText);
});
});
});
JS
);

JFactory::getDocument()->addStyleDeclaration(
<<<CSS
#dragarea {
display: block;
background: rgba(255, 255, 255, .8);
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80);
overflow: hidden;
}
#dragarea::before {
/* Use CSS to inject text since a child element will trigger dragleave event */
content: "{$text}";
width: 100%;
display: block;
font-size: 36px;
text-align: center;
position: absolute;
top: 50%;
}
#dragarea {
display: block;
background: rgba(255, 255, 255, .8);
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80);
overflow: hidden;
}
#dragarea::before {
/* Use CSS to inject text since a child element will trigger dragleave event */
content: "{$text}";
width: 100%;
display: block;
font-size: 36px;
text-align: center;
position: absolute;
top: 50%;
}
CSS
);
?>
Expand Down

0 comments on commit 58ccc98

Please sign in to comment.