35 строки
930 B
HTML
35 строки
930 B
HTML
<script>
|
|
var ChromeSamples = {
|
|
log: function() {
|
|
var line = Array.prototype.slice.call(arguments).map(function(argument) {
|
|
return typeof argument === 'string' ? argument : JSON.stringify(argument);
|
|
}).join(' ');
|
|
|
|
document.querySelector('#log').textContent += line + '\n';
|
|
},
|
|
|
|
clearLog: function() {
|
|
document.querySelector('#log').textContent = '';
|
|
},
|
|
|
|
setStatus: function(status) {
|
|
document.querySelector('#status').textContent = status;
|
|
},
|
|
|
|
setContent: function(newContent) {
|
|
var content = document.querySelector('#content');
|
|
while(content.hasChildNodes()) {
|
|
content.removeChild(content.lastChild);
|
|
}
|
|
content.appendChild(newContent);
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<h3>Live Output</h3>
|
|
<div id="output" class="output">
|
|
<div id="content">{{ include.initial_output_content }}</div>
|
|
<div id="status"></div>
|
|
<pre id="log"></pre>
|
|
</div>
|