Show page Old revisions Backlinks This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. <callout type="primary" icon="true" title="Latest Smoothie commits"> {{ :start/icon-oshw.png?40|}} <html> <script type="text/javascript" src="https://unpkg.com/vue@latest/dist/vue.js"></script> <style id="compiled-css" type="text/css"> #demo { font-family: 'Helvetica', Arial, sans-serif; } a { text-decoration: none; } li { line-height: 1.5em; margin-bottom: 20px; } .author, .date { font-weight: bold; } </style> <!-- TODO: Missing CoffeeScript 2 --> <script type="text/javascript">//<![CDATA[ window.onload=function(){ var apiURL = 'https://api.github.com/repos/smoothieware/smoothieware/commits?per_page=4&sha=' /** * Actual demo */ var demo = new Vue({ el: '#demo', data: { branches: ['edge', 'master'], currentBranch: 'edge', commits: null }, created: function () { this.fetchData() }, watch: { currentBranch: 'fetchData' }, filters: { truncate: function (v) { var newline = v.indexOf('\n') return newline > 0 ? v.slice(0, newline) : v }, formatDate: function (v) { return v.replace(/T|Z/g, ' ') } }, methods: { fetchData: function () { var xhr = new XMLHttpRequest() var self = this xhr.open('GET', apiURL + self.currentBranch) xhr.onload = function () { self.commits = JSON.parse(xhr.responseText) console.log(self.commits[0].html_url) } xhr.send() } } }) } //]]></script> <div id="demo"> <p>smoothieware@{{ currentBranch }}</p> <ul> <li v-for="record in commits"> <a :href="record.html_url" target="_blank" class="commit">{{ record.sha.slice(0, 7) }}</a> - <span class="message">{{ record.commit.message | truncate }}</span><br> by <span class="author"><a :href="record.author.html_url" target="_blank">{{ record.commit.author.name }}</a></span> at <span class="date">{{ record.commit.author.date | formatDate }}</span> </li> </ul> </div> <script> // tell the embed parent frame the height of the content if (window.parent && window.parent.parent){ window.parent.parent.postMessage(["resultsFrame", { height: document.body.getBoundingClientRect().height, slug: "c5g8xnar" }], "*") } // always overwrite window.name, in case users try to set it manually window.name = "result" </script> </body> </html> </callout>