Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995436
load-base-chips.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
load-base-chips.js
View Options
"use strict"
;
const
locreq
=
require
(
"locreq"
)(
__dirname
);
const
AccessStrategyType
=
locreq
(
"lib/chip-types/access-strategy-type.js"
);
const
FieldType
=
locreq
(
"lib/chip-types/field-type.js"
);
const
Collection
=
locreq
(
"lib/chip-types/collection.js"
);
const
BaseChips
=
new
Map
();
BaseChips
.
set
(
AccessStrategyType
,
[
"and"
,
"logged_in"
,
"noone"
,
"not"
,
"or"
,
"owner"
,
"public"
,
"super"
,
"themselves"
]);
BaseChips
.
set
(
FieldType
,
[
"boolean"
,
"color"
,
"context"
,
"date"
,
"datetime"
,
"email"
,
"file"
,
"float"
,
"int"
,
"single_reference"
,
"text"
,
"hashed-text"
,
"username"
,
]);
BaseChips
.
set
(
Collection
,
[
"users"
]);
const
BaseChipDirs
=
new
Map
();
BaseChipDirs
.
set
(
AccessStrategyType
,
"access-strategy-types"
);
BaseChipDirs
.
set
(
FieldType
,
"field-types"
);
BaseChipDirs
.
set
(
Collection
,
"collections"
);
function
load_base_chips
(
app
){
BaseChips
.
forEach
(
function
(
names
,
constructor
){
for
(
const
i
in
names
){
const
chip_name
=
names
[
i
];
let
declaration
=
locreq
(
`lib/app/base-chips/
${
BaseChipDirs
.
get
(
constructor
)
}
/
${
chip_name
}
.js`
);
if
(
declaration
instanceof
Function
){
declaration
=
declaration
(
app
);
}
app
.
createChip
(
constructor
,
declaration
);
}
});
}
module
.
exports
=
load_base_chips
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 04:28 (12 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556814
Default Alt Text
load-base-chips.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment