﻿/// <reference path="jquery.js"/>
(function($) {
    $.fn.linkfilter = function(setting) {
        var ps = $.extend({ cssName: null }, setting);
        return this.each(function() {
            var content = $(this).html();
            content = content.replace(/((http|https)\:\/\/[\.\/\?\&\=\%\-\_\#\(\)\w]*)/g, '<a target="_blank" ' + (ps.cssName != null ? 'class="' + ps.cssName + '"' : '') + ' href="$1" >$1</a>');
            $(this).html(content);
            return true;
        });
    }
})(jQuery);