[#33962] Use a proxy function to close modals.#3918
[#33962] Use a proxy function to close modals.#3918okonomiyaki3000 wants to merge 4 commits intojoomla:stagingfrom
Conversation
|
Hmm, we would still not be able to change SqueezeBox to something else before Joomla 4.0 where we can break B/C. So I'm not sure if this PR really achieves anything in the end. |
|
This is not an issue of breaking B/C and this is not about changing the default modal provider in Joomla. This is future-proofing and giving more power to users. Suppose I, as a user, want to write a template for my site that uses some other modal dialog provider. I want to do this by overriding Besides that, there are some things that actually can't be overridden easily. For example, if I use the editor on site (instead of the admin) and I click the The Bootstrap modal is not really equivalent and not really a replacement for SqueezeBox without adding quite a bit of custom code. Besides, for consistency, you'd want to use only one or the other and A little off topic but, since you brought up |
|
If it's to allow better template overrides, then you should also imho move the javascript loading to an overrideable place (like using JLayout or loading the JS from a file in media folder). Also it will only solve this for core extensions. Any 3rd party extension probably still uses SqueezeBox.close(). That's why I think it doesn't solve a lot. |
|
All JHtml functions are already easily overrideable using There is a solution that will solve this for the special case that you mention. It's not necessary to include it here as executable code but a comment with details on how to do it would be helpful. I'll add it soon. |
I know it's possible. But you need a system plugin to do that. Our goal is to allow all output be easily overriden by a template, without the need for plugins or other coding. |
|
I like layouts a lot. I really do. But I hope they don't become the hammer that makes everything look like a nail. I think layouts are best when used for rendering a block of html or, in some cases, javascript. The JHtml functions still seem to me like the best place to load javascript and css files but maybe that's because I don't shy away from making my own plugins. If the issue is that they're not easy enough to override, why don't we look at ways to make that easier? Suppose there was a designated place inside your template directory where you could place some functions that would automatically override JHtml functions? I think it makes more sense than layouts for everything. |
Valid point of course. |
|
@okonomiyaki3000 Can you update this PR? Since it has merge conflicts it can't be tested properly. Thanks. |
There was a problem hiding this comment.
What's this anyway?
There was a problem hiding this comment.
It's a bit weird, isn't it?
There was a problem hiding this comment.
I tend to agree that it looks wrong. Looks more like a leftover to me.
|
Yes, definitely a leftover. @Bakual can you please remove that line? I am on vacation this week and it's improbable I'll have enough time to open the laptop at all :) |
|
Removed the comment. |
As of comment in #3918 (comment)
|
OK, done. |
|
|
|
Github say that this pull request contains merge conflicts that must be resolved. Can you have a look into it? |
ad01c37 to
f1cf38a
Compare
|
👌 |
|
thanks @okonomiyaki3000 tested successful |
|
@test Success |
|
Moving to RTC since we have 2 successful tests. |
|
This has to be updated to staging |
d63f02a to
cd243bd
Compare
|
Doing some cleanup on a few lines that are not mine so that Travis will pass. I've noticed a few things. First, the PHPCS standard works fine for most code but it has some issues with template code. Often, if you write something like <?php foreach ($someArray as $item) : ?>
<div>etc...</div>
<?php endforeach; ?>You may see some complaints about blank lines found at the start of control structures and etc. Also, there appears to be an extra |
There was a problem hiding this comment.
What's going on at the end of this line anyway? That can't be right, can it?
There was a problem hiding this comment.
@okonomiyaki3000 Agree, that change looks wrong indeed. The original line is fine I guess.
There was a problem hiding this comment.
@roland-d That's not what I mean. Look again. The change just makes the string cleaner by using double quotes instead of escaped single quotes (this whole thing is a single-quoted php string). What we're looking at is something like this:
var x = "some string" + ("some other string", someVar);which is really the same as:
var x = "some string" + someVar;So why is it like this? Am I missing something or is this just some nonsense?
There was a problem hiding this comment.
@okonomiyaki3000 It seems to be a copy-paste result. You are right it can be changed to
window.location="index.php?option=com_menus&view=item&task=item.setType&layout=edit&type=" + type;When is this file called from a non-tmpl view?
There was a problem hiding this comment.
I don't know much about it. it's not really related to this PR but I don't mind fixing it here if you want me to.
|
@okonomiyaki3000 Could you make that final change we discussed and update to the latest staging? After that I can merge this :) |
|
Ah, you want it in this pr? It's not really related but, ok. I can't probably do it till next week though. Now it's お正月休み... |
|
@okonomiyaki3000 The line is already touched by your PR, so I would say it is fine. No worries, next week is fine. Thank you and Happy holidays :) |
|
I may need to rebase this. |
b0972d5 to
138ac88
Compare
|
Looks mergeable now. |
|
@test Success |
|
@test |
|
It's my habit to make strings js safe by using json_encode but it uses double quotes which we do not want in this case. It should be safe to use a non-json encoded string here since it's the output of base64_encode and that should not contain any problematic characters. In any case, that's how the original code was working. |
|
OK now. Thanks. |
|
@test All good here as well. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3918. |
|
So the RTC state is good here. 😄 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3918. |
Because otherwise, we will always be stuck with SqueezeBox/Mootools.
Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33962&start=0