@@ -6,36 +6,36 @@ window.$rdf = UI.rdf
66document . addEventListener ( 'DOMContentLoaded' , function ( ) {
77 /// ///////////////////////////////////////////
88
9- var kb = UI . store
10- var dom = document
9+ const kb = UI . store
10+ const dom = document
1111
12- var ICAL = $rdf . Namespace ( 'http://www.w3.org/2002/12/cal/ical#' )
13- var SCHED = $rdf . Namespace ( 'http://www.w3.org/ns/pim/schedule#' )
14- var DC = $rdf . Namespace ( 'http://purl.org/dc/elements/1.1/' )
12+ const ICAL = $rdf . Namespace ( 'http://www.w3.org/2002/12/cal/ical#' )
13+ const SCHED = $rdf . Namespace ( 'http://www.w3.org/ns/pim/schedule#' )
14+ const DC = $rdf . Namespace ( 'http://purl.org/dc/elements/1.1/' )
1515
16- var uri = window . location . href
17- var base = ( window . document . title = uri . slice ( 0 , uri . lastIndexOf ( '/' ) + 1 ) )
18- var testDocURI = base + 'test.ttl' // imaginary doc - just use its URL
19- var testDoc = $rdf . sym ( testDocURI )
20- var subjectURI = testDocURI + '#event1'
21- var meURI = testDocURI + '#a0'
22- var me = kb . sym ( meURI )
16+ const uri = window . location . href
17+ const base = ( window . document . title = uri . slice ( 0 , uri . lastIndexOf ( '/' ) + 1 ) )
18+ const testDocURI = base + 'test.ttl' // imaginary doc - just use its URL
19+ const testDoc = $rdf . sym ( testDocURI )
20+ const subjectURI = testDocURI + '#event1'
21+ const meURI = testDocURI + '#a0'
22+ const me = kb . sym ( meURI )
2323
2424 // var forms_uri = window.document.title = base+ 'forms.ttl';
2525
26- var subject = kb . sym ( subjectURI )
27- var div = dom . getElementById ( 'UITestArea' )
26+ const subject = kb . sym ( subjectURI )
27+ const div = dom . getElementById ( 'UITestArea' )
2828
29- var showResults = function ( ) {
29+ const showResults = function ( ) {
3030 // Now the form for responsing to the poll
3131 //
3232
3333 // div.appendChild(dom.createElement('hr'))
3434
35- var invitation = subject
35+ const invitation = subject
3636
37- var query = new $rdf . Query ( 'Responses' )
38- var v = { }
37+ const query = new $rdf . Query ( 'Responses' )
38+ const v = { }
3939 ; [ 'time' , 'author' , 'value' , 'resp' , 'cell' ] . map ( function ( x ) {
4040 query . vars . push ( ( v [ x ] = $rdf . variable ( x ) ) )
4141 } )
@@ -50,24 +50,24 @@ document.addEventListener('DOMContentLoaded', function () {
5050 @prefix ical: <http://www.w3.org/2002/12/cal/icaltzd#>.\n\
5151 @prefix dc: <http://purl.org/dc/elements/1.1/>.\n";
5252 */
53- var prologue = dom . getElementById ( 'Prologue' ) . textContent
53+ const prologue = dom . getElementById ( 'Prologue' ) . textContent
5454
5555 // var config = dom.getElementById('Config').textContent;
5656 // $rdf.parse(prologue + config, kb, testDocURI, 'text/turtle') // str, kb, base, contentType
5757
58- var tests = dom . getElementById ( 'TestData' ) . children
59- var inputText = function ( tr ) {
58+ const tests = dom . getElementById ( 'TestData' ) . children
59+ const inputText = function ( tr ) {
6060 return tr . children [ 0 ] . children [ 0 ] . textContent
6161 }
62- var output = function ( tr ) {
62+ const output = function ( tr ) {
6363 return tr . children [ 1 ]
6464 }
65- var t = 0
65+ let t = 0
6666 $rdf . parse ( prologue + inputText ( tests [ t ] ) , kb , testDocURI , 'text/turtle' ) // str, kb, base, contentType
6767
68- var options = { }
68+ const options = { }
6969
70- var setAxes = function ( ) {
70+ const setAxes = function ( ) {
7171 options . set_x = kb . each ( subject , SCHED ( 'option' ) ) // @@@@@ option -> dtstart in future
7272 options . set_x = options . set_x . map ( function ( opt ) {
7373 return kb . any ( opt , ICAL ( 'dtstart' ) )
@@ -83,8 +83,8 @@ document.addEventListener('DOMContentLoaded', function () {
8383 // var possibleTimes = kb.each(invitation, SCHED('option'))
8484 // .map(function (opt) { return kb.any(opt, ICAL('dtstart')) })
8585
86- var displayTheMatrix = function ( ) {
87- var matrix = div . appendChild (
86+ const displayTheMatrix = function ( ) {
87+ const matrix = div . appendChild (
8888 UI . matrix . matrixForQuery (
8989 dom ,
9090 query ,
@@ -98,7 +98,7 @@ document.addEventListener('DOMContentLoaded', function () {
9898
9999 matrix . setAttribute ( 'class' , 'matrix' )
100100
101- var refreshButton = dom . createElement ( 'button' )
101+ const refreshButton = dom . createElement ( 'button' )
102102 refreshButton . textContent = 'refresh'
103103 refreshButton . addEventListener (
104104 'click' ,
@@ -111,9 +111,9 @@ document.addEventListener('DOMContentLoaded', function () {
111111 }
112112
113113 // @@ Give other combos too-- see schedule ontology
114- var possibleAvailabilities = [ SCHED ( 'No' ) , SCHED ( 'Maybe' ) , SCHED ( 'Yes' ) ]
114+ const possibleAvailabilities = [ SCHED ( 'No' ) , SCHED ( 'Maybe' ) , SCHED ( 'Yes' ) ]
115115
116- var dataPointForNT = [ ]
116+ const dataPointForNT = [ ]
117117
118118 // var doc = testDoc
119119 options . set_y = options . set_y . filter ( function ( z ) {
@@ -122,8 +122,8 @@ document.addEventListener('DOMContentLoaded', function () {
122122 options . set_y . push ( me ) // Put me on the end
123123
124124 options . cellFunction = function ( cell , x , y , value ) {
125- var refreshColor = function ( ) {
126- var bg = kb . any ( value , UI . ns . ui ( 'backgroundColor' ) )
125+ const refreshColor = function ( ) {
126+ const bg = kb . any ( value , UI . ns . ui ( 'backgroundColor' ) )
127127 if ( bg ) {
128128 cell . setAttribute (
129129 'style' ,
@@ -135,13 +135,13 @@ document.addEventListener('DOMContentLoaded', function () {
135135 refreshColor ( )
136136 }
137137 if ( y . sameTerm ( me ) ) {
138- var callback = function ( ) {
138+ const callback = function ( ) {
139139 refreshColor ( )
140140 } // @@ may need that
141- var selectOptions = { }
142- var predicate = SCHED ( 'availabilty' )
143- var cellSubject = dataPointForNT [ x . toNT ( ) ]
144- var selector = UI . widgets . makeSelectForOptions (
141+ const selectOptions = { }
142+ const predicate = SCHED ( 'availabilty' )
143+ const cellSubject = dataPointForNT [ x . toNT ( ) ]
144+ const selector = UI . widgets . makeSelectForOptions (
145145 dom ,
146146 kb ,
147147 cellSubject ,
@@ -157,16 +157,16 @@ document.addEventListener('DOMContentLoaded', function () {
157157 }
158158 }
159159
160- var matrix = displayTheMatrix ( )
160+ const matrix = displayTheMatrix ( )
161161
162- var agenda = [ ]
162+ const agenda = [ ]
163163
164- var nextTest = function nextTest ( ) {
164+ const nextTest = function nextTest ( ) {
165165 // First take a copy of the DOM the klast test produced
166166 output ( tests [ t ] ) . appendChild ( matrix . cloneNode ( true ) )
167167
168168 t += 1
169- var test = tests [ t ]
169+ const test = tests [ t ]
170170 if ( ! test ) return
171171
172172 kb . removeMany ( undefined , undefined , undefined , testDoc ) // Flush out previous test data
0 commit comments