File: front_page_script.js

package info (click to toggle)
assemblytics 1.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 416 kB
  • sloc: python: 564; perl: 234; php: 124; sh: 94; makefile: 11
file content (26 lines) | stat: -rwxr-xr-x 887 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var analysis_path="analysis.php?code="


//////////////////////////////////////////////////////////////
/////// For index page:
//////////////////////////////////////////////////////////////
function makeid()
{
    var text = "";
    var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

    for( var i=0; i < 20; i++ )
        text += possible.charAt(Math.floor(Math.random() * possible.length));

    return text;
}

function showCode() {
    var code = makeid();
    var url = analysis_path + code
    document.getElementById("analysis_form").innerHTML = '<input type="hidden" name="code" value="' + code + '"><button type="submit" id="submit_button" class="btn btn-lg btn-primary">Submit</button>';
    document.getElementById("myAwesomeDropzone").innerHTML = '<input type="hidden" name="code_hidden" value=' + code + '>';
}

window.onload = showCode();