Sha256: f9e72466f355af5efbaaed584048bcbc4ffb7bae70ce4ff5f65f6143a6244133

Contents?: true

Size: 729 Bytes

Versions: 10

Compression:

Stored size: 729 Bytes

Contents

// Define: Linkify plugin from stackoverflow
(function($){
     var url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g;

      linkifyThis = function () 
      {
			var childNodes = this.childNodes,
			i = childNodes.length;
			while(i--)
			{
				var n = childNodes[i];
				if (n.nodeType == 3) 
				{
					var html = n.nodeValue;
					if (html)
					{
						html = html.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(url2, '$1<a href="$2">$2</a>$5');
						$(n).after(html).remove();
					}
				}
				else if (n.nodeType == 1  &&  !/^(a|button|textarea)$/i.test(n.tagName)) linkifyThis.call(n);
			}
      };
	
	$.fn.linkify = function () 
	{
		this.each(linkifyThis);
	};

})(jQuery);

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
imperavi-rails-0.0.12.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.11.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.10.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.9.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.8.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.7.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.6.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.5.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.4.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js
imperavi-rails-0.0.3.beta app/assets/javascripts/imperavi-rails/imperavi/linkify.js