From 6536d8467f2771cf6fa1f36f59cdaf66f6a3a472 Mon Sep 17 00:00:00 2001 From: Martin Kurtsson Date: Sat, 20 Apr 2013 12:45:11 +0200 Subject: [PATCH] Added support for data-state in section when using external markdown files. --- plugin/markdown/markdown.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 plugin/markdown/markdown.js diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js old mode 100644 new mode 100755 index 3e31203..9ec1bf8 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -31,7 +31,7 @@ return ''; }; - var slidifyMarkdown = function(markdown, separator, vertical) { + var slidifyMarkdown = function(markdown, separator, vertical, state) { separator = separator || '^\n---\n$'; @@ -78,8 +78,8 @@ // flatten the hierarchical stack, and insert
tags for( var k = 0, klen = sectionStack.length; k < klen; k++ ) { markdownSections += typeof sectionStack[k] === 'string' - ? '
' + twrap( sectionStack[k] ) + '
' - : '
' + sectionStack[k].map(twrap).join('
') + '
'; + ? '
' + twrap( sectionStack[k] ) + '
' + : '
' + sectionStack[k].map(twrap).join('
') + '
'; } return markdownSections; @@ -102,7 +102,7 @@ xhr.onreadystatechange = function () { if( xhr.readyState === 4 ) { if (xhr.status >= 200 && xhr.status < 300) { - section.outerHTML = slidifyMarkdown( xhr.responseText, section.getAttribute('data-separator'), section.getAttribute('data-vertical') ); + section.outerHTML = slidifyMarkdown( xhr.responseText, section.getAttribute('data-separator'), section.getAttribute('data-vertical'), section.getAttribute('data-state')); } else { section.outerHTML = '
ERROR: The attempt to fetch ' + url + ' failed with the HTTP status ' + xhr.status + '. Check your browser\'s JavaScript console for more details.' +