I got this Dilaog that is openning perfectly fine... the idea is to add a tag ?box=true to all a href of my page so when the user click and change page the dialog reopen if the user close the dialog it sets the ?box=false
$(function() {
$('#prebox').click(function(e) {
e.preventDefault();
var $this = $(this);
var horizontalPadding = 30;
var verticalPadding = 30;
$('').dialog({
title: ($this.attr('title')) ? $this.attr('title') : 'Pre box',
autoOpen: true,
width: 800,
height: 500,
modal: false,
resizable: true,
hide: 'slide',
close: function(){ $("a")
.each(function()
{
this.href = this.href.replace(/^"?box=true"/,
"?box=false");
});
},
open: function() {
$("a")
.each(function()
{
this.href = this.href.replace(this.href,
this.href + "?box=true");
});
},
autoResize: true,
overlay: {
opacity: 1,
background: "white"
}
}).width(800 - horizontalPadding).height(500 - verticalPadding);
});
});
//edit I got the ?box=true to be added but now I fail a Regex apparently and can't replace the ?box=true by ?box=false on close of the dialog
Thanks for the help
Ps. Sorry for the borked code block -__-