Merge pull request #13341 from owncloud/update-readversionfromtemplate
Read version and product name from update template
This commit is contained in:
commit
f846d1e3f1
2 changed files with 9 additions and 5 deletions
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* @param $el progress list element
|
* @param $el progress list element
|
||||||
*/
|
*/
|
||||||
start: function($el) {
|
start: function($el, options) {
|
||||||
if (this._started) {
|
if (this._started) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
this.addMessage(t(
|
this.addMessage(t(
|
||||||
'core',
|
'core',
|
||||||
'Updating {productName} to version {version}, this may take a while.', {
|
'Updating {productName} to version {version}, this may take a while.', {
|
||||||
productName: OC.theme.name || 'ownCloud',
|
productName: options.productName || 'ownCloud',
|
||||||
version: OC.config.versionstring
|
version: options.version
|
||||||
}),
|
}),
|
||||||
'bold'
|
'bold'
|
||||||
).append('<br />'); // FIXME: these should be ul/li with CSS paddings!
|
).append('<br />'); // FIXME: these should be ul/li with CSS paddings!
|
||||||
|
@ -76,10 +76,14 @@
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.updateButton').on('click', function() {
|
$('.updateButton').on('click', function() {
|
||||||
|
var $updateEl = $('.update');
|
||||||
var $progressEl = $('.updateProgress');
|
var $progressEl = $('.updateProgress');
|
||||||
$progressEl.removeClass('hidden');
|
$progressEl.removeClass('hidden');
|
||||||
$('.updateOverview').addClass('hidden');
|
$('.updateOverview').addClass('hidden');
|
||||||
OC.Update.start($progressEl);
|
OC.Update.start($progressEl, {
|
||||||
|
productName: $updateEl.attr('data-productname'),
|
||||||
|
version: $updateEl.attr('data-version'),
|
||||||
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="update">
|
<div class="update" data-productname="<?php p($_['productName']) ?>" data-version="<?php p($_['version']) ?>">
|
||||||
<div class="updateOverview">
|
<div class="updateOverview">
|
||||||
<h2 class="title bold"><?php p($l->t('%s will be updated to version %s.',
|
<h2 class="title bold"><?php p($l->t('%s will be updated to version %s.',
|
||||||
array($_['productName'], $_['version']))); ?></h2>
|
array($_['productName'], $_['version']))); ?></h2>
|
||||||
|
|
Loading…
Reference in a new issue