Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jdurrant
binana
Commits
eca8dc31
Commit
eca8dc31
authored
Nov 29, 2021
by
jdurrant
Browse files
Restored checkmark component.
parent
9ea3929d
Changes
4
Hide whitespace changes
Inline
Side-by-side
web_app/src/UI/CheckMark.ts
0 → 100644
View file @
eca8dc31
// This file is part of BINANA, released under the Apache 2.0 License. See
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2021 Jacob D. Durrant.
declare
var
Vue
;
/** An object containing the vue-component computed functions. */
let
computedFunctions
=
{};
/** An object containing the vue-component methods functions. */
let
methodsFunctions
=
{};
/** An object containing the vue-component watch functions. */
let
watchFunctions
=
{}
/**
* The vue-component mounted function.
* @returns void
*/
function
mountedFunction
():
void
{}
/**
* Setup the check-mark Vue commponent.
* @returns void
*/
export
function
setup
():
void
{
Vue
.
component
(
"
check-mark
"
,
{
/**
* Get the data associated with this component.
* @returns any The data.
*/
"
data
"
():
any
{
return
{};
},
"
methods
"
:
methodsFunctions
,
"
template
"
:
/* html */
`
<span>
<div class="spacer25px" v-if="value">✔️</div>
<div class="spacer25px" v-else></div>
<slot></slot>
<div class="spacer25px"></div>
</span>
`
,
"
props
"
:
{
"
value
"
:
Boolean
,
},
"
computed
"
:
computedFunctions
,
/**
* Runs when the vue component is mounted.
* @returns void
*/
"
mounted
"
:
mountedFunction
,
"
watch
"
:
watchFunctions
});
}
web_app/src/UI/Tabs/BINANAParams.ts
View file @
eca8dc31
...
...
@@ -32,16 +32,16 @@ let computedFunctions = {
// },
/**
* Gets the text too use on the bond-visible buttton.
*
DEPRECIATED.
Gets the text too use on the bond-visible buttton.
* @returns string The text to use.
*/
"
bondVisBtnTxt
"
():
string
{
if
(
this
.
$store
.
state
[
"
bondVisible
"
])
{
return
"
Interactions
"
;
}
else
{
return
"
<span style='text-decoration: line-through;'>Interactions</span>
"
;
}
},
//
"bondVisBtnTxt"(): string {
//
if (this.$store.state["bondVisible"]) {
//
return "Interactions";
//
} else {
//
return "<span style='text-decoration: line-through;'>Interactions</span>";
//
}
//
},
interactionVisibilityStatus
:
{
get
():
string
{
...
...
@@ -208,42 +208,42 @@ let methodsFunctions = {
},
/**
* Fires when the user indicates s/he would like to change the
color
* scheme.
*
DEPRECIATED.
Fires when the user indicates s/he would like to change the
*
color
scheme.
* @returns void
*/
"
onChangeColor
"
():
void
{
let
newVal
=
undefined
;
switch
(
this
.
$store
.
state
[
"
colorByInteraction
"
])
{
case
Store
.
InteractionColoring
.
MOLECULE
:
newVal
=
Store
.
InteractionColoring
.
INTERACTION
;
break
;
case
Store
.
InteractionColoring
.
INTERACTION
:
newVal
=
Store
.
InteractionColoring
.
NONE
;
// If none, make sure bonds are visible.
this
.
$store
.
commit
(
"
setVar
"
,
{
name
:
"
bondVisible
"
,
val
:
true
});
// "onChangeColor"(): void {
// let newVal = undefined;
// switch (this.$store.state["colorByInteraction"]) {
// case Store.InteractionColoring.MOLECULE:
// newVal = Store.InteractionColoring.INTERACTION;
// break;
// case Store.InteractionColoring.INTERACTION:
// newVal = Store.InteractionColoring.NONE;
break
;
case
Store
.
InteractionColoring
.
NONE
:
n
ewVal
=
Store
.
InteractionColoring
.
MOLECULE
;
break
;
}
//
// If none, make sure bonds are visible.
//
this.$store.commit("setVar", {
//
n
ame: "bondVisible",
//
val: true
//
}
);
this
.
$store
.
commit
(
"
setVar
"
,
{
name
:
"
colorByInteraction
"
,
val
:
newVal
});
// break;
// case Store.InteractionColoring.NONE:
// newVal = Store.InteractionColoring.MOLECULE;
// break;
// }
this
[
"
updateHighlight
"
]();
},
// this.$store.commit("setVar", {
// name: "colorByInteraction",
// val: newVal
// });
// this["updateHighlight"]();
// },
/**
* Runs when the bond-visibility button is pressed. DEPRECIATED, but
*
keep
commented out in case you bring it back in the future.
* Runs when the bond-visibility button is pressed. DEPRECIATED, but
keep
* commented out in case you bring it back in the future.
* @returns void
*/
// "onBondVisChange"(): void {
...
...
@@ -458,9 +458,7 @@ let methodsFunctions = {
* The vue-component mounted function.
* @returns void
*/
function
mountedFunction
():
void
{
this
[
"
webAssemblyAvaialble
"
]
=
Utils
.
webAssemblySupported
();
}
function
mountedFunction
():
void
{}
/**
* Setup the binana-params Vue commponent.
...
...
@@ -844,7 +842,6 @@ export function setup(): void {
"
data
"
()
{
return
{
"
showFileInputs
"
:
true
,
"
webAssemblyAvaialble
"
:
true
,
lastInteractionNameUsed
:
undefined
,
"
forceLigandFileName
"
:
null
,
"
nonProteinResidues
"
:
""
...
...
web_app/src/Vue/Setup.ts
View file @
eca8dc31
...
...
@@ -11,6 +11,7 @@ import * as ThreeDMol from "../UI/ThreeDMol";
import
*
as
OpenModal
from
"
../UI/Modal/OpenModal
"
;
import
*
as
SubSection
from
"
../UI/SubSection
"
;
import
*
as
FormButton
from
"
../UI/Forms/FormButton
"
;
import
*
as
CheckMark
from
"
../UI/CheckMark
"
;
import
{
setupMolLoader
}
from
"
../UI/FileLoaderSystem/MolLoader.Vue
"
;
declare
var
Vue
;
...
...
@@ -25,6 +26,7 @@ export function setup(): void {
Vue
.
use
(
BootstrapVue
)
Vue
.
use
(
Vuex
)
CheckMark
.
setup
();
SubSection
.
setup
();
FormButton
.
setup
();
OpenModal
.
setup
();
...
...
web_app/src/Vue/Store.ts
View file @
eca8dc31
...
...
@@ -132,38 +132,38 @@ export const store = new Vuex.Store({
},
/**
* Set one of the binana parameters.
*
DEPRECIATED.
Set one of the binana parameters.
* @param {*} state The VueX state.
* @param {iVueXParam} payload An object with information about
*
which
binana parameter to set.
* @param {iVueXParam} payload An object with information about
which
* binana parameter to set.
* @returns void
*/
"
setBinanaParam
"
(
state
:
any
,
payload
:
iVueXParam
):
void
{
// By redefining the whole variable, it becomes reactive. Directly
// changing individual properties is not reactive.
state
[
"
binanaParams
"
]
=
Utils
.
getNewObjWithUpdate
(
state
[
"
binanaParams
"
],
payload
.
name
,
payload
.
val
);
},
//
"setBinanaParam"(state: any, payload: iVueXParam): void {
//
// By redefining the whole variable, it becomes reactive. Directly
//
// changing individual properties is not reactive.
//
state["binanaParams"] = Utils.getNewObjWithUpdate(
//
state["binanaParams"],
//
payload.name,
//
payload.val
//
);
//
},
/**
* Set a validation parameter (either validates or doesn't).
*
DEPRECIATED.
Set a validation parameter (either validates or doesn't).
* @param {*} state The VueX state.
* @param {iVueXParam} payload An object containing information
* about what to set.
* @returns void
*/
"
setValidationParam
"
(
state
:
any
,
payload
:
iVueXParam
):
void
{
// By redefining the whole variable, it becomes reactive. Directly
// changing individual properties is not reactive.
state
[
"
validation
"
]
=
Utils
.
getNewObjWithUpdate
(
state
[
"
validation
"
],
payload
.
name
,
payload
.
val
);
},
//
"setValidationParam"(state: any, payload: iVueXParam): void {
//
// By redefining the whole variable, it becomes reactive. Directly
//
// changing individual properties is not reactive.
//
state["validation"] = Utils.getNewObjWithUpdate(
//
state["validation"],
//
payload.name,
//
payload.val
//
);
//
},
/**
* Open the modal.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment