Skip to content
Merged
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
12 changes: 10 additions & 2 deletions preview-src/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -521,23 +521,31 @@ CREATE (n:Node {id: id, test: true, str: 'ing'})
RETURN collect(n) AS ns
----

.noheader
.Codeblock with role=noheader
[source,cypher,role=noheader]
----
UNWIND range(0, 100) AS id
CREATE (n:Node {id: id, test: true, str: 'ing'})
RETURN collect(n) AS ns
----

.nocopy
.Codeblock with role=nocopy
[source,cypher,role=nocopy]
----
UNWIND range(0, 100) AS id
CREATE (n:Node {id: id, test: true, str: 'ing'})
RETURN collect(n) AS ns
----

.Codeblock with role=nocopy noheader
[source,cypher,role=nocopy noheader]
----
UNWIND range(0, 100) AS id
CREATE (n:Node {id: id, test: true, str: 'ing'})
RETURN collect(n) AS ns
----

.Just some pre
....
pom.xml
src/
Expand Down
21 changes: 7 additions & 14 deletions src/js/06-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ document.addEventListener('DOMContentLoaded', function () {

listingBlock.classList.add('has-header')

if (originalTitle) {
if (originalTitle && !listingBlock.classList.contains('noheader')) {
listingBlock.classList.add('has-title')
var titleDiv = document.createElement('div')
titleDiv.className = 'code-title'
Expand All @@ -140,6 +140,8 @@ document.addEventListener('DOMContentLoaded', function () {
headerDivs.push(titleDiv)
}

var inset = createElement('div', 'code-inset')

if (addCopyButton) {
var copyButton = createElement('span', 'btn btn-copy fa fa-copy')

Expand Down Expand Up @@ -168,22 +170,13 @@ document.addEventListener('DOMContentLoaded', function () {
}, 1000)
})

var inset = createElement('div', 'code-inset', copyButton)
if (language !== 'none' && language) inset.dataset.lang = casedLang(language)

inset.appendChild(copyButton)
inset.appendChild(copySuccess)

// if (originalTitle) {
// div.insertBefore(inset, pre)
// } else {
// pre.appendChild(inset)
// }

// pre.appendChild(inset)

headerDivs.push(inset)
}

if (language !== 'none' && language) inset.dataset.lang = casedLang(language)
headerDivs.push(inset)

var header = createElement('div', 'code-header', headerDivs)
div.insertBefore(header, pre)
}
Expand Down