
You can find more scripts that we offer on our web scripts main page.
var mysettings = new WYSIWYG.Settings();
// define the location of the openLinkLibrary addon
mysettings.LinkPopupFile = "addons/linklibrary/insert_hyperlink.php";
// define the width of the insert link popup
mysettings.LinkPopupWidth = 600;
// define the height of the insert link popup
mysettings.LinkPopupHeight = 245;
Replace this:
// set the attributes
WYSIWYG_Core.setAttribute(lin, "href", href);
WYSIWYG_Core.setAttribute(lin, "class", styleClass);
WYSIWYG_Core.setAttribute(lin, "className", styleClass);
WYSIWYG_Core.setAttribute(lin, "target", target);
WYSIWYG_Core.setAttribute(lin, "name", name);
WYSIWYG_Core.setAttribute(lin, "style", style);
With the following code:
// set the attributes
WYSIWYG_Core.setAttribute(lin, "href", href);
if(styleClass) { WYSIWYG_Core.setAttribute(lin, "class", styleClass); }
//WYSIWYG_Core.setAttribute(lin, "className", styleClass);
if(target) { WYSIWYG_Core.setAttribute(lin, "target", target); }
if(name) { WYSIWYG_Core.setAttribute(lin, "name", name); }
if(style) { WYSIWYG_Core.setAttribute(lin, "style", style); }
// Check the insert link popup implementation
var linkPopupFile = this.config[n].PopupsDir + 'insert_hyperlink.html';
var linkPopupWidth = 350;
var linkPopupHeight = 160;
if(typeof this.config[n].LinkPopupFile != "undefined" && this.config[n].LinkPopupFile != "") {
linkPopupFile = this.config[n].LinkPopupFile;
}
if(typeof this.config[n].LinkPopupWidth && this.config[n].LinkPopupWidth > 0) {
linkPopupWidth = this.config[n].LinkPopupWidth;
}
if(typeof this.config[n].LinkPopupHeight && this.config[n].LinkPopupHeight > 0) {
linkPopupHeight = this.config[n].LinkPopupHeight;
}
// Create Link
case "CreateLink":
window.open(this.config[n].PopupsDir + 'insert_hyperlink.html?wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,resizable=0,width=350,height=160,top=' + popupPosition.top + ',left=' + popupPosition.left).focus();
break;
With the following:
// Create Link
case "CreateLink":
window.open(linkPopupFile + '?wysiwyg=' + n, 'popup', 'location=0,status=0,scrollbars=0,resizable=0,width=' + linkPopupWidth + ',height=' + linkPopupHeight + ',top=' + popupPosition.top + ',left=' + popupPosition.left).focus();
break;
WYSIWYG.attach('textarea_id');
And replace it for with the following:
WYSIWYG.attach('textarea_id', mysettings);
Make sure you also replace textarea_id in the above code you just inserted with your actual textarea id
$linkbasedir = '../../uploads';
and
$linkbaseurl = 'wysiwyg/uploads';