// NOTE: These fields aren't mandatory in the sense that snippet generation will fail // if they're not set, but they're really, really, really expected to be there. var _MANDATORY_PARAMS = { scenario: { "SCENARIO_NAME": "scenario name", "SCENARIO_DATE": "scenario date" }, } ; var _MONTH_NAMES = [ // nb: we assume English :-/ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] ; var _DAY_OF_MONTH_POSTFIXES = { // nb: we assume English :-/ 0: "th", 1: "st", 2: "nd", 3: "rd", 4: "th", 5: "th", 6: "th", 7: "th", 8: "th", 9: "th", 10: "th", 11: "th", 12: "th", 13: "th" } ; var gDefaultScenario = null ; var gLastSavedScenario = null ; var gLastSavedScenarioFilename = null ; var gScenarioCreatedTime = null ; // -------------------------------------------------------------------- function generate_snippet( $btn, extra_params ) { // generate the snippet var template_id = $btn.data( "id" ) ; var params = unload_snippet_params( true, template_id ) ; var snippet = make_snippet( $btn, params, extra_params, true ) ; // copy the snippet to the clipboard try { copyToClipboard( snippet ) ; } catch( ex ) { showErrorMsg( "Can't copy to the clipboard:
This scenario has been changed.
Do you want load another scenario, and lose your changes?", { ok: do_on_load_scenario, cancel: function() {}, } ) ; } function do_on_load_scenario() { // FOR TESTING PORPOISES! We can't control a file upload from Selenium (since // the browser will use native controls), so we get the data from a