Skip to content

Commit e556693

Browse files
authored
Merge pull request SolidOS#23 from linkeddata/de-tabulator
Get rid of tabulator global, change tabulator.preferences to UI.preferences
2 parents 6d68ba4 + 34d339f commit e556693

9 files changed

Lines changed: 112 additions & 223 deletions

File tree

src/acl-control.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const utils = require('./utils')
1717
// causes the bowser to lose all its work in tat window and navigate to another page
1818
UI.aclControl.preventBrowserDropEvents = function (document) {
1919
console.log('preventBrowserDropEvents called.')
20-
if (typeof tabulator !== 'undefined') {
21-
if (tabulator.preventBrowserDropEventsDone) return
22-
tabulator.preventBrowserDropEventsDone = true
20+
if (typeof window !== 'undefined') {
21+
if (window.preventBrowserDropEventsDone) return
22+
window.preventBrowserDropEventsDone = true
2323
}
2424

2525
function preventDrag (e) {

src/icons/noun_1180158.svg

Lines changed: 1 addition & 1 deletion
Loading

src/icons/noun_383448.svg

Lines changed: 1 addition & 1 deletion
Loading

src/icons/noun_925021.svg

Lines changed: 1 addition & 1 deletion
Loading

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const UI = {
5151
matrix: require('./matrix'),
5252
messageArea: require('./messageArea'),
5353
pad: require('./pad'),
54+
preferences: require('./preferences'),
5455
store: require('./store'),
5556
table: require('./table'),
5657
tabs: require('./tabs'),

src/ns.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
// thisModule = {}
2-
1+
// Namespaces we commonly use and have acommon prefixes for around solid
2+
//
33
var thisModule = {}
44

55
module.exports = thisModule
66

7-
// tabulator.trace = thisModule // @@@@@@@@@@
8-
97
var $rdf = require('rdflib')
108

119
// This used to be a faw function (no ".expand" but that caused the module exports all to be dropped)
@@ -27,7 +25,7 @@ thisModule.doap = $rdf.Namespace('http://usefulinc.com/ns/doap#')
2725
thisModule.foaf = $rdf.Namespace('http://xmlns.com/foaf/0.1/')
2826
thisModule.http = $rdf.Namespace('http://www.w3.org/2007/ont/http#')
2927
thisModule.httph = $rdf.Namespace('http://www.w3.org/2007/ont/httph#')
30-
thisModule.ical = $rdf.Namespace('http://www.w3.org/2002/12/cal/icaltzd#')
28+
thisModule.icalTZ = $rdf.Namespace('http://www.w3.org/2002/12/cal/icaltzd#') // Beware: not cal:
3129
thisModule.ldp = $rdf.Namespace('http://www.w3.org/ns/ldp#')
3230
thisModule.link = thisModule.tab = thisModule.tabont = $rdf.Namespace('http://www.w3.org/2007/ont/link#')
3331
thisModule.log = $rdf.Namespace('http://www.w3.org/2000/10/swap/log#')

src/preferences.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Solid-UI temporary preferences
2+
// ==============================
3+
//
4+
5+
// This was tabulator . preferences in the tabulator
6+
//
7+
module.exports = { // used for storing user name
8+
value: [],
9+
get: function (k) {
10+
return this.value[k]
11+
},
12+
set: function (k, v) {
13+
if (typeof v !== 'string') {
14+
console.log('Non-string value of preference ' + k + ': ' + v)
15+
throw new Error('Non-string value of preference ' + k + ': ' + v)
16+
}
17+
this.value[k] = v
18+
}
19+
}
20+
// ends

0 commit comments

Comments
 (0)