Last active
February 21, 2018 16:18
-
-
Save djedi/d3c8b68f5cf4a015a5f0fa35e7d94de3 to your computer and use it in GitHub Desktop.
Revisions
-
djedi revised this gist
Feb 21, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ </my-code-sample> <my-code-sample> <table border="1"> <thead> <tr> <td>Head 1</td> -
djedi revised this gist
Feb 20, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,6 @@ export class MyCodeSample { @child('code-sample') codeSample; attached() { this.code = this.codeSample.data.trim(); } } -
djedi revised this gist
Feb 20, 2018 . No changes.There are no files selected for viewing
-
djedi revised this gist
Feb 20, 2018 . 3 changed files with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ <template> <require from="./my-code-sample"></require> <require from="./my-button.html"></require> <my-code-sample> <br><hr><hr> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ <div> <pre><code class="language-markup" au-syntax textcontent.bind="code"></code></pre> </div> <template replaceable part="rendered"></template> </div> <br><br> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import {processContent, child} from 'aurelia-framework'; const stringified = JSON.stringify(originalContent); node.innerHTML = `<code-sample data.bind='${stringified}'></code-sample>`; node.innerHTML += `<template replace-part="rendered">${originalContent}</template>`; return true; }) -
djedi revised this gist
Feb 20, 2018 . 5 changed files with 35 additions and 37 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ <template> <require from="./my-code-sample"></require> <my-code-sample> <br><hr><hr> </my-code-sample> <my-code-sample> <table> <thead> <tr> @@ -18,6 +18,10 @@ </tr> </tbody> </table> </my-code-sample> <my-code-sample> <my-button></my-button> </my-code-sample> </template> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ <template> <button>My Button</button> </template> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,13 +9,12 @@ } </style> <div> <div> <pre><code class="language-markup" au-syntax textcontent.bind="code"></code></pre> </div> <div innerhtml.bind="code"></div> </div> <br><br> </template> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import {processContent, child} from 'aurelia-framework'; @processContent((compiler, resources, node) => { const originalContent = node.innerHTML; const stringified = JSON.stringify(originalContent); node.innerHTML = `<code-sample data.bind='${stringified}'></code-sample>`; node.innerHTML += `<template>${originalContent}</template>`; return true; }) export class MyCodeSample { @child('code-sample') codeSample; attached() { this.code = this.codeSample.data; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,27 +0,0 @@ -
djedi revised this gist
Feb 20, 2018 . No changes.There are no files selected for viewing
-
djedi created this gist
Feb 20, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ <template> <require from="./toggle-code"></require> <toggle-code> <br><hr><hr> </toggle-code> <toggle-code> <table> <thead> <tr> <td>Head 1</td> </tr> </thead> <tbody> <tr> <td>Cell 1</td> </tr> </tbody> </table> </toggle-code> </template> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ export class App { } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ <!doctype html> <html> <head> <title>Aurelia</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body aurelia-app> <h1>Loading...</h1> <script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script> <script src="https://jdanyow.github.io/rjs-bundle/config.js"></script> <script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script> <script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script> <script> require(['aurelia-bootstrapper']); </script> </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ <template> <span style="display: none"><slot></slot></span> <style> pre { background-color: #eee; border: 1px solid #999; padding: 3px 9px; } </style> <div style="${visible ? '' : 'display:none'}"> <div style="${render ? 'display:none' : ''}"> <pre><code class="language-markup" au-syntax textcontent.bind="code"></code></pre> </div> <div style="${render ? '' : 'display:none'}" innerhtml.bind="code"></div> <button click.delegate="renderCode()">Render</button> </div> <button click.delegate="toggleCodeBlock()">${visible ? 'Hide' : 'Show'} Code</button> <br><br> </template> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ import {processContent, child} from 'aurelia-framework'; @processContent((compiler, resources, node) => { const originalContent = node.innerHTML; node.innerHTML = `<hackity-hack style="display:none" data.bind='${JSON.stringify(originalContent)}'></hackity-hack>`; return true; }) export class toggleCode { @child('hackity-hack') hackData; attached() { this.visible = true; this.render = false; this.code = this.hackData.data.trim(); } toggleCodeBlock() { this.visible = !this.visible; } renderCode() { this.render = !this.render; } }