? ? Success

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
9 Jan 2015

This is a redone for #4664 that uses the jModalClose function introduced #3918 from @okonomiyaki3000

What is changed?

Well this PR leaves the current layouts of the editor plugin button untouched in the root folder of Joomla (this is done for B/C) but introduces the usage of bootstrap for Isis template.
The actual rendering of the buttons:

screen shot 2015-01-09 at 4 35 03
screen shot 2015-01-09 at 4 35 14
screen shot 2015-01-09 at 4 35 26

There are two questions here:

@wilsonge Shall I copy the button layout into protostar as well?

@okonomiyaki3000 I made some changes in behavior.php regarding jModalClose (due to the way bootstrap script is working):

        // Attach modal behavior to document
        $document
            ->addScriptDeclaration('
        jQuery(function($) {
            SqueezeBox.initialize(' . $options . ');
            SqueezeBox.assign($("' . $selector . '").get(), {
                parse: "rel"
            });
        });
        if(typeof jModalClose == "function"){
            var fnCode = jModalClose.toString() ;
            fnCode = fnCode.replace(/\}$/, "SqueezeBox.close();\n}");
            window.eval(fnCode);
        }
        else {
            function jModalClose() {
                SqueezeBox.close();
            }
        }'
        );

Is that ok? Especially this part: window.eval(fnCode);

avatar dgt41 dgt41 - open - 9 Jan 2015
avatar jissues-bot jissues-bot - change - 9 Jan 2015
Labels Added: ?
avatar jissues-bot jissues-bot - change - 9 Jan 2015
Labels Added: ?
avatar okonomiyaki3000
okonomiyaki3000 - comment - 10 Jan 2015

I had in mind a different way to override the default modal with a different type. The thing is, JHtmlBehavior::modal, such as it is, is all about using SqueezeBox. If you don't want to use SqueezeBox, it's best to completely override that function with one of your own by using JHtml::register. In other words, you don't need to touch behavior.php.

I guess you're trying to have it such that both kinds of modals are available. I suppose I don't really agree with that idea. If you want to use bootstrap modals (good!) then why not replace SqeezeBox in all cases?

avatar dgt41
dgt41 - comment - 12 Jan 2015

@okonomiyaki3000 I can understand the way you meant this code to be used, totally replace the modal, and of course is a good approach. The point in this particular case, and I guess to some other places in core, is that you might end up having the core with all modals using bootstrap but some old 3pd component will use the mootools modal.
I think this is all about B/C and how we can make different frameworks work together (especially with the upcoming layouts)
I am afraid we end up with two solutions here:
1. Solve it in client side with some code like this one I used here
2. Solve it in server side:
Introduce a function addScriptModalClose (which creates an array similar to _scripts)
Call it and set the code for each modal
On head.php implode the array and render the proxy function

Of course I might be very wrong with my assumptions here and there might be a way easier solution. But then again thats the reason why I raise this concern...

avatar dgt41
dgt41 - comment - 24 Feb 2015

This is for 3.5!!!
In order to successfully test this one you need to apply first #5652.
@phproberto Can you take a look at this one?
The problem here is the way we handle the scripts and the closing function of bootstrap modal.
This might be a slight B/C issue for people already using layouts of those buttons, but I cannot figure out a totally compatible solution. Maybe you can think of something that will do the trick ♻︎

avatar brianteeman brianteeman - change - 24 Feb 2015
Milestone Added:
avatar dgt41
dgt41 - comment - 27 Feb 2015

Needs also #5871

avatar zero-24 zero-24 - change - 8 Mar 2015
Category JavaScript
avatar nueckman
nueckman - comment - 14 Mar 2015

Patch breaks ability to insert image.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5652.
avatar nueckman nueckman - test_item - 14 Mar 2015 - Tested unsuccessfully
avatar dgt41
dgt41 - comment - 14 Mar 2015

@nueckman try to apply also #5871

avatar dgt41
dgt41 - comment - 14 Mar 2015

@nueckman works here, see the video

avatar joomla-cms-bot joomla-cms-bot - change - 3 Jun 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 3 Jun 2015
Labels Added: ?
8b6785c 3 Jun 2015 avatar dgt41 no
avatar dgt41
dgt41 - comment - 9 Jun 2015

@phproberto if you have some spare time can you review this one? Reminder it needs #5871 as well (and if you also apply #5654 you 'll drop mootools completely in front end)

avatar dgt41 dgt41 - close - 13 Jun 2015
avatar dgt41 dgt41 - change - 13 Jun 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-06-13 02:17:13
Closed_By dgt41
avatar dgt41 dgt41 - close - 13 Jun 2015
avatar dgt41 dgt41 - head_ref_deleted - 14 Aug 2015

Add a Comment

Login with GitHub to post a comment