Skip to content

Commit

Permalink
Addressed some issues required for deployment of Mimola
Browse files Browse the repository at this point in the history
Issues: #114, #113 and #112.
  • Loading branch information
burkmarr committed Mar 13, 2021
1 parent c93f4dd commit 2ae5472
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 105 deletions.
Binary file modified identikit/documentation/Deploying your visualisations.docx
Binary file not shown.
Binary file modified identikit/documentation/Deploying your visualisations.pdf
Binary file not shown.
31 changes: 25 additions & 6 deletions identikit/tombio/guiLargeJqueryUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,38 @@
//Add the required visualisation tools
tbv.v.includedVisualisations.forEach(function (toolName, iTool) {

// User can override default toolname in options
if (tbv.opts.toolconfig[toolName] && tbv.opts.toolconfig[toolName].name) {
var displayName = tbv.opts.toolconfig[toolName].name
} else {
var displayName = tbv.js.jsFiles[toolName].toolName
}

var selOpt = $('<option class="needsclick">')
.attr("value", toolName)
.attr("data-class", "vis")
.addClass("visualisation")
.text(tbv.js.jsFiles[toolName].toolName);
//.text(tbv.js.jsFiles[toolName].toolName);
.text(displayName);

toolOptions.push(selOpt);
})

//Add the various info tools
//The option *values* currentVisInfo, kbInfo, visInfo & tombioCitation have software-wide meaning, not just this gui
toolOptions.push($('<option id="optCurrentVisInfo" value="currentVisInfo" class="html" data-class="info"></option>'));
toolOptions.push($('<option value="kbInfo" class="html" data-class="info">About the Knowledge-base</option>'));
toolOptions.push($('<option value="visInfo" class="html" data-class="info">About FSC Identikit</option>'));
toolOptions.push($('<option value="tombioCitation" class="html" data-class="info">Get citation text</option>'));

if (!tbv.opts.dd || tbv.opts.dd.indexOf("help") > -1) {
toolOptions.push($('<option id="optCurrentVisInfo" value="currentVisInfo" class="html" data-class="info"></option>'));
}
if (!tbv.opts.dd || tbv.opts.dd.indexOf("kb") > -1) {
toolOptions.push($('<option value="kbInfo" class="html" data-class="info">About the Knowledge-base</option>'));
}
if (!tbv.opts.dd || tbv.opts.dd.indexOf("identikit") > -1) {
toolOptions.push($('<option value="visInfo" class="html" data-class="info">About FSC Identikit</option>'));
}
if (!tbv.opts.dd || tbv.opts.dd.indexOf("citation") > -1) {
toolOptions.push($('<option value="tombioCitation" class="html" data-class="info">Get citation text</option>'));
}

//Loop through options marked default as selected
toolOptions.forEach(function (opt) {
Expand All @@ -274,7 +291,9 @@
}

//Add reload app option
toolOptions.push($('<option value="reload" class="html" data-class="reload">Reload app</option>'));
if (!tbv.opts.dd || tbv.opts.dd.indexOf("reload") > -1) {
toolOptions.push($('<option value="reload" class="html" data-class="reload">Reload app</option>'));
}

//Append options to select control
$("#tombioGuiLargeJqueryUiVisualisation").append(toolOptions);
Expand Down
48 changes: 35 additions & 13 deletions identikit/tombio/guiOnsenUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,27 +320,48 @@
//Add the required visualisation tools
tbv.v.includedVisualisations.forEach(function (toolName, iTool) {

// User can override default toolname in options
if (tbv.opts.toolconfig[toolName] && tbv.opts.toolconfig[toolName].name) {
var displayName = tbv.opts.toolconfig[toolName].name
} else {
var displayName = tbv.js.jsFiles[toolName].toolName
}

var selOpt = $('<ons-list-item>')
.attr("value", toolName)
.attr("data-class", "vis")
.text(tbv.js.jsFiles[toolName].toolName);
//.text(tbv.js.jsFiles[toolName].toolName);
.text(displayName);

selOpt.append($(icon))

toolOptions.push(selOpt);
})

toolOptions.push($('<ons-list-header>Help &amp; Information</ons-list-header>'));

if (!tbv.opts.dd ||
(tbv.opts.dd.indexOf("help") > -1) ||
(tbv.opts.dd.indexOf("kb") > -1) ||
(tbv.opts.dd.indexOf("identikit") > -1) ||
(tbv.opts.dd.indexOf("citation") > -1)) {
toolOptions.push($('<ons-list-header>Help &amp; Information</ons-list-header>'));
}
//Add the various info tools

//The option *values* currentVisInfo, kbInfo, visInfo & tombioCitation have software-wide meaning, not just this gui
icon = '<div class="left"><ons-icon icon="md-info" class="list-item__icon"></ons-icon></div>'

toolOptions.push($('<ons-list-item id="optCurrentVisInfo" value="currentVisInfo" class="html" data-class="info">' + icon + 'Using the...</ons-list-item>'));
toolOptions.push($('<ons-list-item value="kbInfo" class="html" data-class="info">' + icon + 'About the Knowledge-base</ons-list-item>'));
toolOptions.push($('<ons-list-item value="visInfo" class="html" data-class="info">' + icon + 'About FSC Identikit</ons-list-item>'));
toolOptions.push($('<ons-list-item value="tombioCitation" class="html" data-class="info">' + icon + 'Get citation text</ons-list-item>'));
if (!tbv.opts.dd || tbv.opts.dd.indexOf("help") > -1) {
toolOptions.push($('<ons-list-item id="optCurrentVisInfo" value="currentVisInfo" class="html" data-class="info">' + icon + 'Using the...</ons-list-item>'));
}
if (!tbv.opts.dd || tbv.opts.dd.indexOf("kb") > -1) {
toolOptions.push($('<ons-list-item value="kbInfo" class="html" data-class="info">' + icon + 'About the Knowledge-base</ons-list-item>'));
}
if (!tbv.opts.dd || tbv.opts.dd.indexOf("identikit") > -1) {
toolOptions.push($('<ons-list-item value="visInfo" class="html" data-class="info">' + icon + 'About FSC Identikit</ons-list-item>'));
}
if (!tbv.opts.dd || tbv.opts.dd.indexOf("citation") > -1) {
toolOptions.push($('<ons-list-item value="tombioCitation" class="html" data-class="info">' + icon + 'Get citation text</ons-list-item>'));
}
toolOptions.push($('<ons-list-item id="optPdfInfo" style="display: none">' + icon + '<a href="' + tbv.opts.tombiokbpath + "info.pdf" + '">About this resource PDF</a></ons-list-item>'));

//Show the PDF Info option if info.pdf file is found
Expand All @@ -354,18 +375,19 @@
});

//If developer's section added above, then add a header for standard reload and download
toolOptions.push($('<ons-list-header>Other</ons-list-header>'));

if (tbv.opts.pwa || (!tbv.opts.dd || tbv.opts.dd.indexOf("reload") > -1)) {
toolOptions.push($('<ons-list-header>Other</ons-list-header>'));
}
//Add option for offline options
if (tbv.opts.pwa) {
var icon = '<div class="left"><ons-icon icon="md-download" class="list-item__icon"></ons-icon></div>'
toolOptions.push($('<ons-list-item value="offline" class="html" data-class="?">' + icon + 'Offline options</ons-list-item>'));
}

//Add reload option
var icon = '<div class="left"><ons-icon icon="md-redo" class="list-item__icon"></ons-icon></div>'
toolOptions.push($('<ons-list-item value="reload" class="html" data-class="reload">' + icon + 'Reload app</ons-list-item>'));

if (!tbv.opts.dd || tbv.opts.dd.indexOf("reload") > -1) {
var icon = '<div class="left"><ons-icon icon="md-redo" class="list-item__icon"></ons-icon></div>'
toolOptions.push($('<ons-list-item value="reload" class="html" data-class="reload">' + icon + 'Reload app</ons-list-item>'));
}

//Add click event to the menu items
toolOptions.forEach(function (i) {
Expand Down
Loading

0 comments on commit 2ae5472

Please sign in to comment.