Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui
Commits
ed11b091
Verified
Commit
ed11b091
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: refactoring of ext_bottom_line
parent
efdf7f49
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/js/ext_bottom_line.js
+3
-64
3 additions, 64 deletions
src/core/js/ext_bottom_line.js
with
3 additions
and
64 deletions
src/core/js/ext_bottom_line.js
+
3
−
64
View file @
ed11b091
...
...
@@ -34,7 +34,7 @@
* `conf/core/json/ext_bottom_line.json`.
*
* @module ext_bottom_line
* @version 0.1
* @version 0.1
.1
*
* @requires jQuery (library)
* @requires log (singleton from loglevel library)
...
...
@@ -165,67 +165,6 @@ var ext_bottom_line = function($, logger, is_in_view_port, load_config, getEntit
_css_class_preview_container
}
`
)[
0
];
}
/**
* Add the element to the entity's preview container and remove all other
* content.
*
* This method appends the element (usually a preview, a waiting
* notification or an error message) to the HTMLElement with class
* `caosdb-f-ext_bottom_line-container` which was added to the entity by the
* {@link root_preview_handler}.
*
* If the preview container cannot be found an error is logged, but not
* thrown.
*
* @param {HTMLElement|String} element - A preview, a waiting notification,
* an error message or similar.
* @param {HTMLElement} entity - An entity in HTML Representation which
* must have a (deep) child with class `caosdb-f-ext_bottom_line-container`.
*/
const
set_preview_container
=
function
(
entity
,
element
)
{
// TODO remove
}
/**
* Append a preview to the entity and removes any pre-existing preview.
*
* If the preview is Promise for a preview a waiting notification is added
* to the entity instead and the actual preview is added after the Promise
* is resolved. If the Promise is rejected, a correspondig error is shown
* instead.
*
* @see root_preview_handler
*
* @async
* @param {HTMLElement} entity
* @param {string|HTMLElement|Promise} preview - A preview for an entity or
* a Promise for a preview (which resolves as a string or an HTMLElement as well).
*/
var
set_preview
=
function
(
entity
,
preview
)
{
// TODO remove
}
/**
* Create and return a preview for a given entity.
*
* This root_preview_creator iterates over all the registered creators and
* uses the first match, i.e. the first creator object which return true
* for the `is_applicable(entity)` method of the creator object.
*
* If a creator throws an error during checking whether it `is_applicable`
* or during the `create` the error is logged and the creator is treated as
* if it were not applicable.
*
* @async
* @param {HTMLElement} entity - the entity for which the preview is to be
* created.
* @returns {String|HTMLElement|Promise} A preview which can be added to
* the entity DOM representation or a Promise for such a preview.
*/
var
root_preview_creator
=
async
function
(
entity
)
{
// TODO remove
};
/**
* Add a preview container to the entity.
*
...
...
@@ -300,7 +239,7 @@ var ext_bottom_line = function($, logger, is_in_view_port, load_config, getEntit
if
(
container
)
{
await
ext_applicable
.
root_handler
(
entity
,
container
,
_creators
);
}
else
{
logger
.
error
(
new
Error
(
"
Could not
find
the preview container.
"
));
logger
.
error
(
new
Error
(
"
Could not
create
the preview container.
"
));
}
}
...
...
@@ -319,7 +258,7 @@ var ext_bottom_line = function($, logger, is_in_view_port, load_config, getEntit
*
* @param {BottomLineConfig} config
*/
var
configure
=
async
function
(
config
)
{
var
configure
=
async
function
(
config
,
default_config
)
{
logger
.
debug
(
"
configure
"
,
config
);
if
(
config
.
version
!=
"
0.1
"
)
{
throw
new
Error
(
"
Wrong version in config.
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment