Added support for @xml:lang and blockquote@cite to Maruku.
Added Javascript styling for blockquote@cite.
This commit is contained in:
parent
d4b947462b
commit
f896f8fbdc
4 changed files with 29 additions and 3 deletions
23
public/javascripts/page_helper.js
Normal file
23
public/javascripts/page_helper.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* Based on Simon Willison's blockquotes.js
|
||||
* http://simon.incutio.com/archive/2002/12/20/#blockquoteCitations
|
||||
*/
|
||||
function extractBlockquoteCitations() {
|
||||
var quotes = document.getElementsByTagName('blockquote');
|
||||
for (i = 0; i < quotes.length; i++) {
|
||||
var cite = quotes[i].getAttribute('cite');
|
||||
if (cite && cite != '') {
|
||||
var newlink = document.createElement('a');
|
||||
newlink.setAttribute('href', cite);
|
||||
newlink.setAttribute('title', cite);
|
||||
newlink.appendChild(document.createTextNode('#'));
|
||||
var newspan = document.createElement('span');
|
||||
newspan.setAttribute('class','blockquotesource');
|
||||
newspan.appendChild(newlink);
|
||||
quotes[i].lastChild.previousSibling.appendChild(newspan);
|
||||
}
|
||||
}
|
||||
}
|
||||
window.onload = function (){
|
||||
extractBlockquoteCitations();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue