mirror of
https://github.com/WatchOutNewsAgency/wona.github.com.git
synced 2026-01-01 01:16:26 +00:00
updated syntax style, added javascript for expanding code blocks
This commit is contained in:
@ -33,6 +33,7 @@ google_analytics: true
|
||||
var tweet_count = #{page.tweet_count};
|
||||
%script(src="/javascripts/mootools-yui-compressed.js" type="text/javascript")
|
||||
%script(src="/javascripts/mootools-1.2.4.2-more.js" type="text/javascript")
|
||||
%script(src="/javascripts/octopress.js" type="text/javascript")
|
||||
%script(src="/javascripts/twitter.js" type="text/javascript")
|
||||
- if page.respond_to? :google_analytics
|
||||
%script(src="http://www.google-analytics.com/ga.js" type="text/javascript")
|
||||
|
||||
34
source/javascripts/octopress.js
Normal file
34
source/javascripts/octopress.js
Normal file
@ -0,0 +1,34 @@
|
||||
window.addEvent('domready', function() {
|
||||
addPreExpanders();
|
||||
});
|
||||
|
||||
function addPreExpanders(){
|
||||
$$('div.highlight').each(function(div){
|
||||
addExpander(div);
|
||||
});
|
||||
}
|
||||
function addExpander(div){
|
||||
new Element('span',{
|
||||
html: 'expand »',
|
||||
'class': 'pre_expander',
|
||||
'styles': {
|
||||
'display': 'block'
|
||||
},
|
||||
'events': {
|
||||
'click': function(){
|
||||
toggleExpander();
|
||||
}
|
||||
}
|
||||
}).inject(div, 'top');
|
||||
}
|
||||
function toggleExpander(){
|
||||
var html = '';
|
||||
if($('main').toggleClass('expanded').hasClass('expanded')){
|
||||
html = '« contract';
|
||||
} else {
|
||||
html = 'expand »';
|
||||
}
|
||||
$$('div.highlight span.pre_expander').each(function(span){
|
||||
span.set('html',html);
|
||||
});
|
||||
}
|
||||
@ -2,18 +2,19 @@
|
||||
layout: default
|
||||
title: Syntax Highlighting Debug
|
||||
---
|
||||
{% highlight ruby linenos %}
|
||||
def rebuild_site(relative)
|
||||
puts ">>> Change Detected to: #{relative} <<<"
|
||||
IO.popen('rake generate') do |io|
|
||||
print(io.readpartial(512)) until io.eof?
|
||||
end
|
||||
puts '>>> Update Complete <<<'
|
||||
{% highlight ruby %}
|
||||
def rebuild_site(relative)
|
||||
puts ">>> Change Detected to: #{relative} <<<"
|
||||
IO.popen('rake generate') do |io|
|
||||
print(io.readpartial(512)) until io.eof?
|
||||
end
|
||||
|
||||
puts '>>> Update Complete <<<'
|
||||
end
|
||||
{% endhighlight %}
|
||||
|
||||
{% highlight ruby linenos %}
|
||||
So that's a small example. What about a big one?
|
||||
|
||||
{% highlight ruby %}
|
||||
require 'active_support/core_ext/array'
|
||||
require 'active_support/core_ext/hash/except'
|
||||
require 'active_support/core_ext/object/metaclass'
|
||||
|
||||
Reference in New Issue
Block a user