@@ -333,8 +333,9 @@ <h2 id="twoLineWidgetForClass"><a href="#twoLineWidgetForClass">twoLineWidgetFor
333333 < h2 id ="isAudio "> < a href ="#isAudio "> isAudio</ a > </ h2 >
334334 < script id ="script-isAudio ">
335335 window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
336- // const result = UI.widgets.isAudio()
337- // $('#div-isAudio').appendChild(document.createTextNode(result))
336+ UI . store . add ( UI . rdf . namedNode ( 'http://example.com/audio.mpeg' ) , UI . ns . rdf ( 'type' ) , UI . rdf . namedNode ( 'http://www.w3.org/ns/iana/media-types/audio' ) )
337+ const result = UI . widgets . isAudio ( UI . rdf . namedNode ( 'http://example.com/audio.mpeg' ) )
338+ $ ( '#div-isAudio' ) . appendChild ( document . createTextNode ( result ) )
338339 } )
339340 </ script >
340341 < pre id ="viewSource-isAudio "> </ pre > < script > $ ( '#viewSource-isAudio' ) . innerHTML = $ ( '#script-isAudio' ) . innerText </ script >
@@ -343,8 +344,9 @@ <h2 id="isAudio"><a href="#isAudio">isAudio</a></h2>
343344 < h2 id ="isImage "> < a href ="#isImage "> isImage</ a > </ h2 >
344345 < script id ="script-isImage ">
345346 window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
346- // const result = UI.widgets.isImage()
347- // $('#div-isImage').appendChild(document.createTextNode(result))
347+ UI . store . add ( UI . rdf . namedNode ( 'http://example.com/image.jpeg' ) , UI . ns . rdf ( 'type' ) , UI . rdf . namedNode ( 'http://www.w3.org/ns/iana/media-types/image' ) )
348+ const result = UI . widgets . isImage ( UI . rdf . namedNode ( 'http://example.com/image.jpeg' ) )
349+ $ ( '#div-isImage' ) . appendChild ( document . createTextNode ( result ) )
348350 } )
349351 </ script >
350352 < pre id ="viewSource-isImage "> </ pre > < script > $ ( '#viewSource-isImage' ) . innerHTML = $ ( '#script-isImage' ) . innerText </ script >
@@ -353,8 +355,9 @@ <h2 id="isImage"><a href="#isImage">isImage</a></h2>
353355 < h2 id ="isVideo "> < a href ="#isVideo "> isVideo</ a > </ h2 >
354356 < script id ="script-isVideo ">
355357 window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
356- // const result = UI.widgets.isVideo()
357- // $('#div-isVideo').appendChild(document.createTextNode(result))
358+ UI . store . add ( UI . rdf . namedNode ( 'http://example.com/video.mov' ) , UI . ns . rdf ( 'type' ) , UI . rdf . namedNode ( 'http://www.w3.org/ns/iana/media-types/video' ) )
359+ const result = UI . widgets . isImage ( UI . rdf . namedNode ( 'http://example.com/video.mov' ) )
360+ $ ( '#div-isVideo' ) . appendChild ( document . createTextNode ( result ) )
358361 } )
359362 </ script >
360363 < pre id ="viewSource-isVideo "> </ pre > < script > $ ( '#viewSource-isVideo' ) . innerHTML = $ ( '#script-isVideo' ) . innerText </ script >
0 commit comments