Always show the application name in the help navbar.

master
Pacman Ghost 6 years ago
parent e9393aac91
commit 86746f0324
  1. 7
      vasl_templates/webapp/main.py
  2. 2
      vasl_templates/webapp/static/help/index.html
  3. 2
      vasl_templates/webapp/static/help/main.css
  4. 7
      vasl_templates/webapp/static/help/main.js
  5. 17
      vasl_templates/webapp/static/main.js

@ -21,11 +21,8 @@ def main():
def show_help():
"""Show the help page."""
url = url_for( "static", filename="help/index.html" )
args = []
for arg in ("embedded","tab","pyqt"):
if request.args.get( arg ):
args.append( "{}={}".format( arg, request.args[arg] ) )
if args:
if request.args:
args = [ "{}={}".format( arg, request.args[arg] ) for arg in request.args ]
url += "?{}".format( "&".join( args ) )
return redirect( url, code=302 )

@ -19,6 +19,8 @@
<!-- ----------------------------------------------------------------- -->
<div id="app-name" style="display:none;"> VASL Templates </div>
<div id="helptabs" style="display:none;">
<ul>

@ -10,6 +10,8 @@ p { margin-top: 0.5em ; }
/* -------------------------------------------------------------------- */
#app-name { position: fixed ; top: 2px ; left: 10px ; font-size: 1.8em ; color: #444 ; }
#helptabs { width: 100% ; height: calc(100% - 50px) ; background: none ; border: none ; }
#helptabs-content { height: 100% ; margin-top: 10px ; overflow: auto ; }

@ -3,6 +3,13 @@
$(document).ready( function() {
// set the application name
var $caption = $( "#app-name" ) ;
var version = getUrlParam( "version" ) ;
if ( version )
$caption.html( $caption.html() + " <small>(" + version + ")</small>" ) ;
$caption.fadeIn( 500 ) ;
// catch clicks on links
// FUDGE! We have to do a bit of stuffing around to open links in an external window,
// so that things will work when we're inside the desktop app.

@ -602,26 +602,11 @@ function show_help()
if ( ! $iframe.attr( "src" ) ) {
// yup - make it so
// NOTE: We show the help in an iframe so that we can use the same files elsewhere e.g. on the web site or Github.
var url = gHelpUrl + "?embedded=1&tab=userguide" ;
var url = gHelpUrl + "?version=" + gAppVersion + "&embedded=1&tab=userguide" ;
if ( getUrlParam( "pyqt" ) )
url += "&pyqt=1" ;
$iframe.attr( "src", url ) ;
$("#tabs .ui-tabs-tab[aria-controls='tabs-help']").show() ;
setTimeout( function() { // nb: give the iframe time to become visible
// insert the app name/version
var pos = $iframe.position() ;
var buf = [ "<div style='display:none;",
"font-size: 1.8em; color: #555;",
"position: absolute; top: " + Math.ceil(pos.top) + "px; left: " + Math.ceil(pos.left) + "px;",
"padding-left: 5px;",
"'>",
gAppName + " <small>(" + gAppVersion + ")</small>",
"</div>",
] ;
var $elem = $( buf.join("") ) ;
$iframe.after( $elem ) ;
$elem.fadeIn( 500 ) ;
}, 200 ) ;
}
// show the HELP tab

Loading…
Cancel
Save