aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorMartin Kurtsson <martin.kurtsson@screeninteraction.com>2013-04-20 12:45:11 +0200
committerMartin Kurtsson <martin.kurtsson@screeninteraction.com>2013-04-20 12:45:11 +0200
commit6536d8467f2771cf6fa1f36f59cdaf66f6a3a472 (patch)
tree01b939e9d5dbd70862c990ef85ea6d78f8b9cb65 /plugin
parenta18b2a94cfd8120596c109e2319ff3694f29c39c (diff)
downloadperl-software-in-gnu-guix-6536d8467f2771cf6fa1f36f59cdaf66f6a3a472.tar
perl-software-in-gnu-guix-6536d8467f2771cf6fa1f36f59cdaf66f6a3a472.tar.gz
Added support for data-state in section when using external markdown files.
Diffstat (limited to 'plugin')
-rwxr-xr-x[-rw-r--r--]plugin/markdown/markdown.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js
index 3e31203..9ec1bf8 100644..100755
--- a/plugin/markdown/markdown.js
+++ b/plugin/markdown/markdown.js
@@ -31,7 +31,7 @@
return '<script type="text/template">' + el + '</script>';
};
- 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 <section data-markdown> tags
for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
markdownSections += typeof sectionStack[k] === 'string'
- ? '<section data-markdown>' + twrap( sectionStack[k] ) + '</section>'
- : '<section><section data-markdown>' + sectionStack[k].map(twrap).join('</section><section data-markdown>') + '</section></section>';
+ ? '<section data-state="' + state + '" data-markdown>' + twrap( sectionStack[k] ) + '</section>'
+ : '<section data-state="' + state + '"><section data-markdown>' + sectionStack[k].map(twrap).join('</section><section data-markdown>') + '</section></section>';
}
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 = '<section data-state="alert">ERROR: The attempt to fetch ' + url + ' failed with the HTTP status ' + xhr.status +
'. Check your browser\'s JavaScript console for more details.' +