diff --git a/src/strapdown.js b/src/strapdown.js index 15bd7d1..4514987 100644 --- a/src/strapdown.js +++ b/src/strapdown.js @@ -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); diff --git a/v/0.2/strapdown.js b/v/0.2/strapdown.js index ecef869..785d4a2 100644 --- a/v/0.2/strapdown.js +++ b/v/0.2/strapdown.js @@ -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);