Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996108
chip.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
chip.js
View Options
var
Promise
=
require
(
"bluebird"
);
var
ChipManager
=
null
;
var
chip
=
function
(
add_to_chip_manager
,
type
,
name
){
this
.
configuration
=
{};
Object
.
defineProperty
(
this
,
"default_configuration"
,
{
set
:
this
.
apply_default_settings
})
this
.
type
=
type
;
this
.
name
=
name
;
this
.
longid
=
type
+
"."
+
name
;
if
(
add_to_chip_manager
)
{
var
ChipManager
=
ChipManager
||
require
(
"./chip-manager.js"
);
ChipManager
.
add_chip
(
type
,
name
,
this
);
}
}
chip
.
prototype
=
new
function
(){
this
.
apply_default_settings
=
function
(
default_config
){
for
(
var
i
in
default_config
)
{
if
(
!
this
.
configuration
[
i
])
{
this
.
configuration
[
i
]
=
default_config
[
i
];
}
}
}
this
.
configure
=
function
(
config
){
config
=
config
||
{};
this
.
configuration
=
config
;
}
this
.
start
=
function
(){
//to be overwritten
return
Promise
.
resolve
();
}
this
.
test
=
function
(){
if
(
this
.
test_compatibility
)
{
console
.
log
(
"Starting compatibility tests for chip: `"
+
this
.
name
+
"`"
);
this
.
test_compatibility
().
then
(
function
(){
console
.
log
(
"\t✓ Compatibility test successfull!"
);
})
}
}
}
module
.
exports
=
chip
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 10:32 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556348
Default Alt Text
chip.js (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment