if (!RedactorPlugins) var RedactorPlugins = {};
(function($)
{
RedactorPlugins.definedlinks = function()
{
return {
init: function()
{
if (!this.opts.definedLinks) return;
this.modal.addCallback('link', $.proxy(this.definedlinks.load, this));
},
load: function()
{
var $select = $('');
$('#redactor-modal-link-insert').prepend($select);
this.definedlinks.storage = {};
$.getJSON(this.opts.definedLinks, $.proxy(function(data)
{
$.each(data, $.proxy(function(key, val)
{
this.definedlinks.storage[key] = val;
$select.append($('