Skip to content

Commit 8ce9b86

Browse files
samokissSamuel Gomistomglvng
authored
feat(ODX-1): update snippets theme for guided tutorial (#750)
* feat(ODX-1): update snippets theme * feat(ODX-1): fix integration + js * feat(ODX-1): fix * feat(ODX-1): fix * feat(ODX-1): fix * feat(ODX-1): fix * Update src/partials/guided-tutorials.handlebars Co-authored-by: Thomas Galvaing <[email protected]> Co-authored-by: Samuel Gomis <[email protected]> Co-authored-by: Thomas Galvaing <[email protected]>
1 parent 0e44753 commit 8ce9b86

File tree

9 files changed

+10991
-1574
lines changed

9 files changed

+10991
-1574
lines changed

content/swagger/akeneo-web-api.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package-lock.json

Lines changed: 9149 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"dependencies": {
77
"bootstrap": "3.4.1",
88
"font-awesome": "4.7.0",
9+
"isotope-layout": "3.0.6",
910
"jquery": "3.5.1",
1011
"lato-font": "3.0.0",
11-
"isotope-layout": "3.0.6"
12+
"prismjs": "^1.29.0"
1213
},
1314
"devDependencies": {
1415
"del": "2.2.2",

src/partials/guided-tutorials.handlebars

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,27 @@
55
{{{mainContent}}}
66
</div>
77
</div>
8+
<script type="text/javascript">
9+
$( document ).ready(function() {
10+
$('.code-tabs li:first-child').addClass('active');
11+
});
12+
function copySnippetContent(event){
13+
const copyToClipboard = $(this);
14+
copyToClipboard.text("Copied!");
15+
copyToClipboard.addClass("copied");
16+
setTimeout(function() {
17+
copyToClipboard.removeClass('copied');
18+
copyToClipboard.text("Copy");
19+
}, 3000);
20+
21+
const parentTextContent = event.target.parentElement.firstChild.innerText;
22+
navigator.clipboard.writeText(parentTextContent);
23+
}
24+
$( "pre" ).append( `<span class="copy-to-clipboard-button">Copy</span>`);
25+
$('.copy-to-clipboard-button').click(copySnippetContent);
26+
$('.code-tabs li').click(function(){
27+
$(this).parent().children().removeClass('active');
28+
$(this).addClass('active');
29+
});
30+
</script>
831
{{/layout}}

src/partials/layout.handlebars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<script src='/js/bootstrap.min.js'></script>
1010
<script src="/js/isotope.pkgd.min.js"></script>
1111
<link rel="icon" type="image/png" href="/img/akene36.png">
12+
<link rel="stylesheet" href="/css/prism-okaidia.css">
1213
<link rel="stylesheet" href="/css/variables.css">
1314
<link rel="stylesheet" href="/css/font-awesome.min.css">
1415
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css">

0 commit comments

Comments
 (0)