Skip to content

Commit

Permalink
Optional Info button for projects that need a link to project info #350
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroberts committed Mar 7, 2023
1 parent dc6f97b commit 0d430e6
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
11 changes: 11 additions & 0 deletions config/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,15 @@ function initialize() {
) {
$("#tab_look #look_fullscreen").prop("checked", true);
}
if (
cData.look &&
(cData.look.info == true || cData.look.info == null)
) {
$("#tab_look #look_info").prop("checked", true);
}
$("#tab_look #look_infourl").val(
cData.look ? cData.look.infourl : ""
);
if (
cData.look &&
(cData.look.help == true || cData.look.help == null)
Expand Down Expand Up @@ -2137,6 +2146,8 @@ function save(returnJSON) {
json.look["copylink"] = $("#tab_look #look_copylink").prop("checked");
json.look["screenshot"] = $("#tab_look #look_screenshot").prop("checked");
json.look["fullscreen"] = $("#tab_look #look_fullscreen").prop("checked");
json.look["info"] = $("#tab_look #look_info").prop("checked");
json.look["infourl"] = $("#tab_look #look_infourl").val();
json.look["help"] = $("#tab_look #look_help").prop("checked");
json.look["logourl"] = $("#tab_look #look_logourl").val();
json.look["helpurl"] = $("#tab_look #look_helpurl").val();
Expand Down
5 changes: 5 additions & 0 deletions src/css/mmgis.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ body {
#topBar {
}

#topBarInfo {
width: 24px;
height: 24px;
}

#topBarHelp {
width: 24px;
height: 24px;
Expand Down
6 changes: 6 additions & 0 deletions src/essence/Ancillary/Stylize.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ export function stylize() {
)
$('#favicon').attr('href', L_.configData.look.logourl)
}
if (L_.configData.look.infourl && L_.configData.look.infourl != '') {
$('#topBarInfo').on('click', function () {
let win = window.open(L_.configData.look.infourl, '_mmgisinfo')
win.focus()
})
}
if (L_.configData.look.helpurl && L_.configData.look.helpurl != '') {
$('#topBarHelp').on('click', function () {
let win = window.open(L_.configData.look.helpurl, '_mmgishelp')
Expand Down
30 changes: 29 additions & 1 deletion src/essence/Basics/UserInterface_/BottomBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,39 @@ let BottomBar = {
theme: 'blue',
})

// Info
bottomBar
.append('i')
.attr('id', 'topBarInfo')
.attr('title', 'Info')
.attr('tabindex', 105)
.attr('class', 'mmgisHoverBlue mdi mdi-information-variant mdi-18px')
.style('padding', '5px 10px')
.style('width', '40px')
.style('height', '36px')
.style('line-height', '26px')
.style('cursor', 'pointer')
.on('click', function () {
this.infoOn = !this.infoOn
if (this.infoOn) {
d3.select('#viewer_Info').style('display', 'inherit')
} else {
d3.select('#viewer_Info').style('display', 'none')
}
})

tippy(`#topBarInfo`, {
content: `Info`,
placement: 'right',
theme: 'blue',
})

// Help
bottomBar
.append('i')
.attr('id', 'topBarHelp')
.attr('title', 'Help')
.attr('tabindex', 105)
.attr('tabindex', 106)
.attr('class', 'mmgisHoverBlue mdi mdi-help mdi-18px')
.style('padding', '5px 10px')
.style('width', '40px')
Expand Down Expand Up @@ -462,6 +489,7 @@ let BottomBar = {
}
}
},
toggleInfo: function () {},
toggleHelp: function () {},
fullscreen: function () {
var isInFullScreen =
Expand Down
5 changes: 5 additions & 0 deletions src/essence/Basics/UserInterface_/UserInterface_.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,11 @@ var UserInterface = {
display: l_.configData.look.settings ? 'inherit' : 'none',
})

if (l_.configData.look && l_.configData.look.info != null)
$('#topBarInfo').css({
display: l_.configData.look.info ? 'inherit' : 'none',
})

if (l_.configData.look && l_.configData.look.help != null)
$('#topBarHelp').css({
display: l_.configData.look.help ? 'inherit' : 'none',
Expand Down
9 changes: 9 additions & 0 deletions views/configure.pug
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,15 @@ script(type='text/javascript' src='config/pre/RefreshAuth.js')
#look_fullscreenEl.input-field.col.s2.push-s2
input#look_fullscreen.filled-in.checkbox-color(type='checkbox')
label(for='look_fullscreen' style='color: black;') Fullscreen
li.row.title
.col.s2.push-s2 User Info
li.row.checkboxRow
#look_helpEl.input-field.col.s2.push-s2
input#look_info.filled-in.checkbox-color(type='checkbox')
label(for='look_info' style='color: black;') Info
#look_helpurlEl.input-field.col.s6.push-s2
input#look_infourl.validate(type='text' value='')
label(for='look_infourl') Info URL
li.row.title
.col.s2.push-s2 User Help
li.row.checkboxRow
Expand Down

0 comments on commit 0d430e6

Please sign in to comment.