Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/strapdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,20 @@
var theme = markdownEl.getAttribute('theme') || 'bootstrap';
theme = theme.toLowerCase();

// Check remote flag
var remote = markdownEl.getAttribute('remote') || false;

// Stylesheets
var linkEl = document.createElement('link');
linkEl.href = originBase + '/themes/'+theme+'.min.css';
if (remote) {
if (theme === 'bootstrap') {
linkEl.href = '//netdna.bootstrapcdn.com/twitter-bootstrap/latest/css/bootstrap.min.css';
} else {
linkEl.href = '//netdna.bootstrapcdn.com/bootswatch/latest/' + theme + '/bootstrap.min.css';
}
} else {
linkEl.href = originBase + '/themes/' + theme + '.min.css';
}
linkEl.rel = 'stylesheet';
document.head.appendChild(linkEl);

Expand Down
13 changes: 12 additions & 1 deletion v/0.2/strapdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,20 @@ var PR=win['PR']={'createSimpleLexer':createSimpleLexer,'registerLangHandler':re
var theme = markdownEl.getAttribute('theme') || 'bootstrap';
theme = theme.toLowerCase();

// Check remote flag
var remote = markdownEl.getAttribute('remote') || false;

// Stylesheets
var linkEl = document.createElement('link');
linkEl.href = originBase + '/themes/'+theme+'.min.css';
if (remote) {
if (theme === 'bootstrap') {
linkEl.href = '//netdna.bootstrapcdn.com/twitter-bootstrap/latest/css/bootstrap.min.css';
} else {
linkEl.href = '//netdna.bootstrapcdn.com/bootswatch/latest/' + theme + '/bootstrap.min.css';
}
} else {
linkEl.href = originBase + '/themes/' + theme + '.min.css';
}
linkEl.rel = 'stylesheet';
document.head.appendChild(linkEl);

Expand Down