diff --git a/vasl_templates/webapp/static/generate.js b/vasl_templates/webapp/static/generate.js index 01bca26..86367dd 100644 --- a/vasl_templates/webapp/static/generate.js +++ b/vasl_templates/webapp/static/generate.js @@ -96,7 +96,7 @@ function generate_snippet( $btn ) if ( missing_params.length > 0 ) { var buf = [ "Missing parameters:" ) ; showWarningMsg( buf.join("") ) ; } @@ -123,7 +123,7 @@ function generate_snippet( $btn ) else if ( template_id in gDefaultTemplates ) templ = gDefaultTemplates[template_id] ; else { - showErrorMsg( "Unknown template: " + escapeHTML(template_id) ) ; + showErrorMsg( "Unknown template: " + escapeHTML(template_id) + "" ) ; return ; } var func ; @@ -131,7 +131,7 @@ function generate_snippet( $btn ) func = jinja.compile( templ ).render ; } catch( ex ) { - showErrorMsg( "Can't compile template:
" + escapeHTML(ex) + "
" ) ; + showErrorMsg( "Can't compile template:
" + escapeHTML(ex) + "
" ) ; return ; } @@ -147,14 +147,14 @@ function generate_snippet( $btn ) val = val.trim() ; } catch( ex ) { - showErrorMsg( "Can't process template \"" + template_id + "\":
" + escapeHTML(ex) + "
" ) ; + showErrorMsg( "Can't process template: " + template_id + "
" + escapeHTML(ex) + "
" ) ; return ; } try { copyToClipboard( val ) ; } catch( ex ) { - showErrorMsg( "Can't copy to the clipboard:
" + escapeHTML(ex) + "
" ) ; + showErrorMsg( "Can't copy to the clipboard:
" + escapeHTML(ex) + "
" ) ; return ; } showInfoMsg( "The HTML snippet has been copied to the clipboard." ) ; @@ -207,7 +207,7 @@ function on_load_scenario_file_selected() try { data = JSON.parse( fileReader.result ) ; } catch( ex ) { - showErrorMsg( "Can't load the scenario file:
" + escapeHTML(ex) + "
" ) ; + showErrorMsg( "Can't load the scenario file:
" + escapeHTML(ex) + "
" ) ; return ; } do_load_scenario( data ) ; @@ -250,7 +250,7 @@ function do_load_scenario( params ) var buf = [] ; for ( key in params ) { if ( ! (key in params_loaded) ) - buf.push( "
  • " + key + " = '" + escapeHTML(params[key]) + "'" ) ; + buf.push( "
  • " + escapeHTML(key) + " = '" + escapeHTML(params[key]) + "'" ) ; } if ( buf.length > 0 ) showWarningMsg( "Unknown keys in the scenario file:" ) ; diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index 741d997..be0843e 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -113,7 +113,7 @@ $(document).ready( function () { $("select[name='PLAYER_2']").html( buf ) ; on_new_scenario( false ) ; } ).fail( function( xhr, status, errorMsg ) { - showErrorMsg( "Can't get the nationalities:
    " + escapeHTML(errorMsg) + "
    " ) ; + showErrorMsg( "Can't get the nationalities:
    " + escapeHTML(errorMsg) + "
    " ) ; } ) ; // add handlers for player changes diff --git a/vasl_templates/webapp/static/utils.js b/vasl_templates/webapp/static/utils.js index 5c16634..ebd7ec2 100644 --- a/vasl_templates/webapp/static/utils.js +++ b/vasl_templates/webapp/static/utils.js @@ -23,7 +23,7 @@ function copyToClipboard( val ) console.log( "CLIPBOARD:", val ) ; } catch( ex ) { - showErrorMsg( "Can't copy to the clipboard:
    " + escapeHTML(ex) + "
    " ) ; + showErrorMsg( "Can't copy to the clipboard:
    " + escapeHTML(ex) + "
    " ) ; } finally { document.body.removeChild( textarea ) ;