Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
16d3000a
Commit
16d3000a
authored
Jan 15, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add samuel's flags by div as module loading config feature
parent
1d6a7be1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
extras_explorerjs.js
extras_explorerjs.js
+24
-0
settings_explorerjs.js
settings_explorerjs.js
+8
-0
main.js
tinawebJS/main.js
+3
-0
No files found.
extras_explorerjs.js
View file @
16d3000a
...
...
@@ -482,6 +482,30 @@ function trackMouse() {
}
// This is for adding/removing features from TinawebJS
// each key is simultaneously 3 things:
// - the key of a bool config value in DivsFlags (settings_explorerjs)
// - the dir of the submodule's files (and its init.js)
// - the css class of all html elements added by the submodule
function
ProcessDivsFlags
()
{
for
(
var
key
in
TW
.
DivsFlags
)
{
if
(
TW
.
DivsFlags
[
key
]
===
false
)
{
// $("#"+key).remove() ; // previous logic by id
$
(
"."
+
key
).
remove
()
;
// new logic by class
}
else
{
console
.
log
(
"extras:ProcessDivsFlags: key is true: "
+
key
)
// load JS+CSS items corresponding to the flagname
// ex: flag = crowdsourcingTerms
// ==> JS = crowdsourcingTerms/init.js
// ==> CSS = crowdsourcingTerms/submodule.css
my_src_dir
=
key
loadJS
(
my_src_dir
+
"/init.js"
)
;
}
}
}
//both obsolete
function
closeDialog
()
{
$
(
'#windowTitleDialog'
).
modal
(
'hide'
);
...
...
settings_explorerjs.js
View file @
16d3000a
...
...
@@ -36,6 +36,14 @@ var TW = {}
// field["data/20141215_GPs_04.gexf"] = "ISItermsfirstindexing";
TW
.
Relations
=
{}
// module_names to load
// ----------------------
TW
.
DivsFlags
=
{}
;
// flag name is div class to be removed if false
// *and* subdirectory to import if true
// see also ProcessDivsFlags()
//ex: TW.DivsFlags["crowdsourcingTerms"] = true ;
TW
.
SystemStates
=
{}
TW
.
SystemStates
.
level
=
true
;
TW
.
SystemStates
.
type
=
[
true
]
//[ true , false ]; //social activated!
...
...
tinawebJS/main.js
View file @
16d3000a
...
...
@@ -361,6 +361,9 @@ if(RES["OK"]) {
}
else
alert
(
"error: "
+
RES
[
"data"
])
// load optional modules
ProcessDivsFlags
()
;
console
.
log
(
"finish"
)
...
...
Write
Preview
Markdown
is supported
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