/themes/kit/js/kit/jquery.kit-source.js
https://bitbucket.org/allanfreitas/bugitor · JavaScript · 21 lines · 15 code · 0 blank · 6 comment · 0 complexity · d181dffe9534d926f6867f25de36dbc1 MD5 · raw file
- /*global jQuery */
- /*!
- * Lettering.JS 0.6.1
- *
- * Crawl the elements page and show example source code
- */
- (function($){
- $('article.element .markup').wrap('<div class="example">');
- $('article.element .markup').each(function(){
- var thisHTML = $(this).html().replace('</textarea>', '</textarea>');
- $(this).after('<div class="show-source"><div class="show-hide">show source</div><textarea class="show-source-textarea">'+ thisHTML +'</textarea></div>');
- $(this).find('+ .show-source textarea.show-source-textarea').height($(this).height()).css('min-height', '100px').hide();
- $(this).find('+ .show-source .show-hide').toggle(function(){
- $(this).html('hide source');
- $(this).find('+ textarea.show-source-textarea').slideDown();
- }, function(){
- $(this).html('show source');
- $(this).find('+ textarea.show-source-textarea').slideUp();
- });
- });
- })(jQuery);