? Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
20 Jan 2019

Pull Request for Issue # .

Summary of Changes

The core.js is supposed to be the JS API of Joomla but we keep sneaking methods there with the expectation that these will be useful to somebody...
Since js is becoming more modular inflating some file is against the common practice. So there you have it, methods that are specific to some other functionality are moved to the related files.
Moved:

  • Joomla.iframeButtonClick The method applies only to iframes in modals, so the method is moved to the modal initiator file (legacy/bootstrap-init.js)

  • Joomla.localStorageEnabled The method is used only in the backend menu so it's moved there

  • Joomla.resetFilters The method works only on the search tools (filters) so it's also moved there (searchtools.js)

  • Consistenly use Joomla.Text instead of the Joomla.JText. (the later is still working but deprecated)

Testing Instructions

Check in the backend that:

  • The menu still works
  • Try in the Menus the Site/Administrator dropdown
  • For the modal close you need to disable the redirect plugin, then go to the System->redirects and on the message that says that the plugin needs to be enabled click on the link. A modal will open change the settings then save and close. Then refresh the page. The plugin should be enabled

Expected result

Actual result

TODO

  • Joomla.renderMessages needs to be cleaned as J4 has only one messaging system so no point supporting also the Bootstrap.

  • Joomla.Event that it was introduced in J4 some time ago needs to be completely removed
    There is zero benefit having a shortcut for the native methods:
    screenshot 2019-01-20 at 15 04 37
    @Fedik do you agree on this one, as you're the one that introduced it?

Documentation Changes Required

None

avatar dgrammatiko dgrammatiko - open - 20 Jan 2019
avatar dgrammatiko dgrammatiko - change - 20 Jan 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2019
Category JavaScript Repository
avatar dgrammatiko dgrammatiko - change - 20 Jan 2019
Labels Added: ?
avatar dgrammatiko dgrammatiko - change - 20 Jan 2019
The description was changed
avatar dgrammatiko dgrammatiko - edited - 20 Jan 2019
avatar dgrammatiko dgrammatiko - change - 20 Jan 2019
The description was changed
avatar dgrammatiko dgrammatiko - edited - 20 Jan 2019
avatar dgrammatiko
dgrammatiko - comment - 20 Jan 2019

@zero-24 why the tests are failing here? Seems unrelated

avatar Fedik
Fedik - comment - 20 Jan 2019

do you agree on this one, as you're the one that introduced it?

hm, need to think,
It is still good to have it, so people see that we offer/support some "joomla specific" events.
However everyone still free to use them directly.
It not that much code.

About once listener, well, if we do not need ie11, then can remove.

avatar dgrammatiko
dgrammatiko - comment - 20 Jan 2019

About once listener, well, if we do not need ie11, then can remove.

Actually doing something similar to your approach for delivering ES6+ code to the browser you could also add this tiny polyfill https://github.com/WebReflection/dom4. So all the Event, plus a myriad of other things will be supported in IE 11 (eg closest).

so people see that we offer/support some "joomla specific" events.

Well if Joomla is doing a middleware for Javascript something is going wrong... About the what we offer: Provide proper documentation of the Joomla related events and how those could be used (with examples). IIRC only subforms utilise this

avatar zero-24
zero-24 - comment - 20 Jan 2019

@zero-24 why the tests are failing here? Seems unrelated

hmm looks good to me now. When this here is ready I would suggest to also merge 4.0-dev in so the checks run on the latest code :)

avatar zero-24
zero-24 - comment - 20 Jan 2019

This mostly fixes drone / rips issues too ;)

avatar Fedik
Fedik - comment - 21 Jan 2019

well, once listener you can remove, it not that often used feature.

Provide proper documentation of the Joomla related events and how those could be used (with examples)

Yeah sure, documentation.
For me it is not critical. I leave it for your and @wilsonge decision.

avatar infograf768
infograf768 - comment - 22 Jan 2019

Redirect plugin can now be saved, but:
The Save button also Closes the modal and the plugin is checked out.

avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2019

Opps, side effect, will patch it later on

avatar infograf768
infograf768 - comment - 22 Jan 2019

Also, it does not solve #23260 where we do have an issue in modal-fields.js

avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2019

modal-fields.js is totally broken IIRC. That script needs to be redone as it's really bad from many aspects...

avatar gnanakeethan
gnanakeethan - comment - 22 Jan 2019

@dgrammatiko may I try fixing it?

avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2019

@gnanakeethan sure, it should be custom element, similar to: #20788

avatar gnanakeethan
gnanakeethan - comment - 22 Jan 2019

@dgrammatiko Thanks. Where should I start? 4.0-dev branch or the previously worked PR?

Can I cherry-pick those changes otherwise?

avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2019

I'll say fresh start...

avatar dgrammatiko
dgrammatiko - comment - 22 Jan 2019

@infograf768 should be fine now

avatar infograf768
infograf768 - comment - 23 Jan 2019

@dgrammatiko
No more issue for the redirect plugin.
One notch, but it may be unrelated to this PR: the Redirect Manager is not reloaded after closing the plugin, therefore we do not get any Message about the status of the plugin.

avatar infograf768
infograf768 - comment - 25 Jan 2019

I have tested this item successfully on a2b01da


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

avatar infograf768
infograf768 - comment - 25 Jan 2019

I have tested this item successfully on a2b01da


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

avatar infograf768 infograf768 - test_item - 25 Jan 2019 - Tested successfully
avatar wilsonge
wilsonge - comment - 31 Jan 2019

@zero-24 @SniperSister RIPS please (tried twice so I assume it’s not a glitch)

avatar wilsonge wilsonge - change - 31 Jan 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-01-31 12:52:11
Closed_By wilsonge
avatar wilsonge wilsonge - close - 31 Jan 2019
avatar wilsonge wilsonge - merge - 31 Jan 2019
avatar wilsonge
wilsonge - comment - 31 Jan 2019

Thanks!

avatar infograf768
infograf768 - comment - 16 Nov 2019

@dgrammatiko

#23600 (comment)

Has this been done?

avatar dgrammatiko
dgrammatiko - comment - 19 Nov 2019

@infograf768 unless someone else made a PR for this probably not. I need to find some spare time to do this

Add a Comment

Login with GitHub to post a comment