Skip to content

Remove progressbar.js dependency from com_joomlaupdate#6769

Closed
dgrammatiko wants to merge 9 commits intojoomla:stagingfrom
dgrammatiko:_update_progressbar_bootstrap
Closed

Remove progressbar.js dependency from com_joomlaupdate#6769
dgrammatiko wants to merge 9 commits intojoomla:stagingfrom
dgrammatiko:_update_progressbar_bootstrap

Conversation

@dgrammatiko
Copy link
Copy Markdown
Contributor

This is similar to #5386

Use the bootstrap javascript for rendering the progress bar

bootstrap.framework is always loaded in ISIS and HATHOR so it’s better to use that library instead of loading one more script!

B/C

The html markup is changed
The relative js file is not loaded anymore

Testing

Try to install a 3.4 site apply this patch and then update it to 3.4.1 or the latest staging
Or if you are already on staging, do this:
Apply this PR
In the #__extensions table find the row with extension_id=700 and edit the manifest_cache field. Change the "version":"3.4.2-dev" part of it with "version":"3.4.0"
Edit the libraries/cms/version/version.php file and change public $DEV_LEVEL = '2-dev'; (your version may be different!) to public $DEV_LEVEL = '0';
Now login to administrator and update joomla!
You should see a progress bar like this:

screen shot 2015-04-19 at 7 18 43

This removes one more Mootools dependency, yay!

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@nikosdion Nikola can you take a look at this one, as I struggle to get the update.js to jquery as a 1 to 1 conversion and I don’t won’t to touch restore.php?
Thanks

@nikosdion
Copy link
Copy Markdown
Contributor

If you find yourself in need to touch restore.php you are doing something extremely wrong! In fact, com_joomlaupdate's Javascript was backported from jQuery to mooTools when I contributed this feature. The newer version of the jQuery code is now part of Akeeba CMS Update and you can find it at https://github.com/akeeba/cmsupdate/blob/master/component/media/js/common.js

Please keep in mind that CMS Update uses a private copy of jQuery in the cmsupdate.jQuery object. You need to change cmsupdate.jQuery to window.jQuery. The methods you need to copy are doEncryptedAjax, pingExtract, startExtract, stepExtract, finalizeUpdate and also the functions empty and is_array (the latter two come from the awesome php.js library). Normally my Javascript is licensed under GPLv3 but I do give my permission to relicense it under "GPLv2 or any later version published by the Free Software Foundation" which is compatible with Joomla!.

And thus, with one swift change, you can remove all mooTools dependencies from Joomla! Update. You're welcome :)

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@nikosdion First and foremost mille grazie for your code! Once again!
Can you check that what I included in update.js is ok with you?
I owe you some beers for that 🍻

@wilsonge can you also check update.js in this PR? Do we need another comments block or this is fine?
In essence this is Nikolas’s code with few alterations to fit the html classes we use in the relative layout

@nikosdion
Copy link
Copy Markdown
Contributor

Can you give me some time to review it until Monday evening? My laptop was stolen, I replaced it, but now I have to get everything properly set up.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

WOW that sucks! I hope you’ve got at least a backup of all the precious staff of your laptop. No rush here...

@nikosdion
Copy link
Copy Markdown
Contributor

I can see that the total size of the update file being extracted (and, as a result, the percentage done) is always zero.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@nikosdion Thanks Nick, I changed the script to reflect on values:
screen shot 2015-04-19 at 7 18 42
screen shot 2015-04-19 at 7 18 43

@nikosdion
Copy link
Copy Markdown
Contributor

In file administrator/components/com_joomlaupdate/controller.php change line 46 from

$model = $this->getModel($vName);

to

$model = $this->getModel('default');

This should fix the fatal error.

@wilsonge wilsonge added this to the Joomla! 3.5.0 milestone May 29, 2015
@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 30, 2015

@test successfully. Thanks 👍


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6769.

@dgrammatiko
Copy link
Copy Markdown
Contributor Author

@losedk do you have few minutes spare to test this one?
Thanks!

@peterlose
Copy link
Copy Markdown
Contributor

@DGT41 Just tested. No errors on update, so I guess that's a successful test :)

@anibalsanchez
Copy link
Copy Markdown
Contributor

@test on staging + 6769.diff. It has worked perfectly!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6769.

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Jun 6, 2015

Great 😄 RTC!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6769.

@zero-24 zero-24 added the RTC This Pull Request is Ready To Commit label Jun 6, 2015
@mbabker
Copy link
Copy Markdown
Contributor

mbabker commented Jul 11, 2015

Merged to 3.5-dev via 577ed48

@dgrammatiko dgrammatiko deleted the _update_progressbar_bootstrap branch August 14, 2015 16:27
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants