User tests: Successful: Unsuccessful:
This is a redone for #4664 that uses the jModalClose function introduced #3918 from @okonomiyaki3000
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:
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);
Labels |
Added:
?
|
Labels |
Added:
?
|
@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...
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 ♻︎
Milestone |
Added: |
Category | ⇒ | JavaScript |
Patch breaks ability to insert image.
Labels |
Added:
?
|
Labels |
Added:
?
|
@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)
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-13 02:17:13 |
Closed_By | ⇒ | dgt41 |
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 usingSqueezeBox
. If you don't want to useSqueezeBox
, it's best to completely override that function with one of your own by usingJHtml::register
. In other words, you don't need to touchbehavior.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?