1 jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
2 var showPassed, showSkipped;
4 this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
5 this.createDom('div', { className: 'banner' },
6 this.createDom('div', { className: 'logo' }),
7 this.createDom('div', { className: 'options' },
8 this.createDom('div', { className: 'show' },
9 this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
10 showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' })
12 this.createDom('div', { className: 'show' },
13 this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped"),
14 showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' })
16 this.createDom('div', { className: 'show' },
17 this.createDom('label', { "for": "__jasmine_TrivialReporter_automaticReload__" }," automatic reload"),
18 automaticReload = this.createDom('input',
19 (window.location.hash == "#reload") ? {id: "__jasmine_TrivialReporter_automaticReload__", type: 'checkbox', checked: true } : {id: "__jasmine_TrivialReporter_automaticReload__", type: 'checkbox'}
25 this.runnerDiv = this.createDom('div', { className: 'runner running' },
26 this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
27 this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
28 this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
31 this.document.body.appendChild(this.outerDiv);
33 var suites = runner.suites();
34 for (var i = 0; i < suites.length; i++) {
35 var suite = suites[i];
36 var suiteDiv = this.createDom('div', { className: 'suite' },
37 this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
38 this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
39 this.suiteDivs[suite.id] = suiteDiv;
40 var parentDiv = this.outerDiv;
41 if (suite.parentSuite) {
42 parentDiv = this.suiteDivs[suite.parentSuite.id];
44 parentDiv.appendChild(suiteDiv);
47 this.startedAt = new Date();
50 showPassed.onchange = function(evt) {
51 if (evt.target.checked) {
52 self.outerDiv.className += ' show-passed';
54 self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
58 showSkipped.onchange = function(evt) {
59 if (evt.target.checked) {
60 self.outerDiv.className += ' show-skipped';
62 self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
66 automaticReload.onchange = function(evt) {
67 if (evt.target.checked) {
68 window.location.hash = "#reload";
69 window.location.reload();
71 window.location.hash = "";
72 window.location.reload();
77 if (window.location.hash == "#reload") {
78 var interval = setInterval(function() {
79 var isRunning = jasmine.getEnv().currentRunner_.queue.isRunning();
81 clearInterval(interval);
83 setTimeout(function() {
84 window.location.reload();