diff --git a/www/conservancy/static/js/jquery.outerhtml.js b/www/conservancy/static/js/jquery.outerhtml.js new file mode 100644 index 0000000000000000000000000000000000000000..1aed405acd7a3504d6e1b24fecdf67f370d52d17 --- /dev/null +++ b/www/conservancy/static/js/jquery.outerhtml.js @@ -0,0 +1,20 @@ +/* + * jQuery outerHTML + * + * Copyright (c) 2008 Ca-Phun Ung + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://yelotofu.com/labs/jquery/snippets/outerhtml/ + * + * outerHTML is based on the outerHTML work done by Brandon Aaron + * But adds the ability to replace an element. + */ + +(function($) { + $.fn.outerHTML = function(s) { + return (s) + ? this.before(s).remove() + : $('

').append(this.eq(0).clone()).html(); + } +})(jQuery);