Yes ! I managed to understand how this squeezebox worked :) And I can delete force the user to wait until the end of saving ! (by disabling the closure of the squeezebox).
Little explanations : Squeezebox don't come with K2, they are integrated to Joomla, so we can use everywhere, it's just a type of window. K2 use the squeezebox for adding item for example, through the class "modal" in the add link :)
In fact, it's the modal.js file who control all these squeezebox, So I looked into the file modal.js, and we can see al options when a squeezebox is created :
var SqueezeBox = {
presets: {
size: {x: 600, y: 450},
sizeLoading: {x: 200, y: 150},
marginInner: {x: 20, y: 20},
marginImage: {x: 150, y: 200},
handler: false,
adopt: null,
closeWithOverlay: true,
zIndex: 65555,
overlayOpacity: 0.7,
classWindow: '',
classOverlay: '',
disableFx: false,
onOpen: Class.empty,
onClose: Class.empty,
onUpdate: Class.empty,
onResize: Class.empty,
onMove: Class.empty,
onShow: Class.empty,
onHide: Class.empty,
fxOverlayDuration: 250,
fxResizeDuration: 750,
fxContentDuration: 250,
ajaxOptions: {}
},
And, here, I see WHAT ?! : closeWithOverlay !!!!
So I simply add this option and set to false in my code, and it works, now when you clicked outside of the animation squeezebox, it don't exit anything, it just forced the user to wait the end of saving :)
And I think these squeeze box are really interesting things, and i'm going to study all the others options :p.
So here is the new function chargement :
function chargement(){
SqueezeBox.initialize();
SqueezeBox.fromElement(this, {
handler: 'iframe',
url: '
www.notreassurance.com/img/gif-anime_80px.gif',
size: {x: 80, y: 80}, closeWithOverlay: false,
onShow:$('sbox-window').setStyles({'padding': 0}),
onShow:$('sbox-btn-close').setStyles({'background': 'none'}),
onShow:$('sbox-btn-close').setStyles({'height': 0}),
});
}
Can you please test the various error cases ? For example, I had a bug with the animation when the users forget the title, or the category, I fix it, but maybe I forget something...
Thanks ;) Now, the code is preatty clean, and I understand what I'm doing :)