33 Outline Mode Manager
44*/
55import * as paneRegistry from 'pane-registry'
6+ import './manager.css'
67import * as $rdf from 'rdflib'
78import * as UI from 'solid-ui'
89import { authn , authSession , store } from 'solid-logic'
@@ -170,11 +171,12 @@ export default function (context) {
170171 statement
171172 ) {
172173 const td = dom . createElement ( 'td' )
173- td . setAttribute (
174- 'style' ,
175- 'margin: 0.2em; border: none; padding: 0; vertical-align: top;'
176- )
174+ td . classList . add ( 'obj' )
177175 td . setAttribute ( 'notSelectable' , 'false' )
176+ td . style . margin = '0.2em'
177+ td . style . border = 'none'
178+ td . style . padding = '0'
179+ td . style . verticalAlign = 'top'
178180 const theClass = 'obj'
179181
180182 // set about and put 'expand' icon
@@ -198,7 +200,6 @@ export default function (context) {
198200 ) . addEventListener ( 'click' , expandMouseDownListener )
199201 }
200202 td . setAttribute ( 'class' , theClass ) // this is how you find an object
201- // @@ TAKE CSS OUT OF STYLE SHEET
202203 if ( kb . whether ( obj , UI . ns . rdf ( 'type' ) , UI . ns . link ( 'Request' ) ) ) {
203204 td . className = 'undetermined'
204205 } // @@? why-timbl
@@ -249,10 +250,7 @@ export default function (context) {
249250 // if (kb.statementsMatching(predicate,rdf('type'), UI.ns.link('Request')).length) predicateTD.className='undetermined';
250251
251252 const labelTD = dom . createElement ( 'TD' )
252- labelTD . setAttribute (
253- 'style' ,
254- 'margin: 0.2em; border: none; padding: 0; vertical-align: top;'
255- )
253+ labelTD . classList . add ( 'labelTD' )
256254 labelTD . setAttribute ( 'notSelectable' , 'true' )
257255 labelTD . appendChild ( dom . createTextNode ( lab ) )
258256 predicateTD . appendChild ( labelTD )
@@ -345,7 +343,7 @@ export default function (context) {
345343 const me = authn . currentUser ( )
346344 if ( ! me ) return [ ]
347345 const div = dom . createElement ( 'div' )
348- const [ books , pods ] = await Promise . all ( [ getAddressBooks ( ) , getPods ( ) ] )
346+ const [ pods ] = await Promise . all ( [ getPods ( ) ] )
349347 return [
350348 {
351349 paneName : 'home' ,
@@ -368,7 +366,6 @@ export default function (context) {
368366 icon : UI . icons . iconBase + 'noun_492246.svg'
369367 }
370368 ]
371- . concat ( books )
372369 . concat ( pods )
373370
374371 async function getPods ( ) {
@@ -808,7 +805,7 @@ export default function (context) {
808805 const table = d . parentNode
809806 const par = table . parentNode
810807 const placeholder = dom . createElement ( 'table' )
811- placeholder . setAttribute ( 'style' , 'width: 100%; ')
808+ placeholder . classList . add ( 'placeholderTable ')
812809 par . replaceChild ( placeholder , table )
813810 table . removeChild ( d )
814811 par . replaceChild ( table , placeholder ) // Attempt to
@@ -827,7 +824,7 @@ export default function (context) {
827824 if ( ! table ) {
828825 // Create a new property table
829826 table = dom . createElement ( 'table' )
830- table . setAttribute ( 'style' , 'width: 100%; ')
827+ table . classList . add ( 'tableFullWidth ')
831828 expandedHeaderTR ( subject , pane , options ) . then ( tr1 => {
832829 table . appendChild ( tr1 )
833830
@@ -2365,7 +2362,7 @@ export default function (context) {
23652362 } else if ( obj . termType === 'Collection' ) {
23662363 // obj.elements is an array of the elements in the collection
23672364 rep = dom . createElement ( 'table' )
2368- rep . setAttribute ( 'style' , 'width: 100%; ')
2365+ rep . classList . add ( 'tableFullWidth ')
23692366 rep . setAttribute ( 'about' , obj . toNT ( ) )
23702367 /* Not sure which looks best -- with or without. I think without
23712368
@@ -2377,10 +2374,7 @@ export default function (context) {
23772374 const elt = obj . elements [ i ]
23782375 const row = rep . appendChild ( dom . createElement ( 'tr' ) )
23792376 const numcell = row . appendChild ( dom . createElement ( 'td' ) )
2380- numcell . setAttribute (
2381- 'style' ,
2382- 'margin: 0.2em; border: none; padding: 0; vertical-align: top;'
2383- )
2377+ numcell . classList . add ( 'obj' )
23842378 numcell . setAttribute ( 'notSelectable' , 'false' )
23852379 numcell . setAttribute ( 'about' , obj . toNT ( ) )
23862380 numcell . innerHTML = i + 1 + ')'
0 commit comments