<commit_before>module Application {
    export var READY:string = "savvy-load";
}

module application {
    
    export var id:string = null;
    export var isCordova:boolean = false;
    export var version:string = null;
    
    export var cards:HTMLElement[] = [];
    export var header:HTMLElement = null;
    export var footer:HTMLElement = null;
    export var main:HTMLElement = null;
    export var defaultCard:HTMLElement = null;
    export var currentCard:HTMLElement = null;
    
    export function goto(path:string, transition:Transition = Transition.CUT, preventHistory:boolean = false):void {
        throw "application.goto has not been over-written. Is there a problem with the order that Savvy is built?";
    }
    
    export function getRoute():string {
        var hash:string = window.location.hash;
        var path:string;
        if(hash == "" || hash == "#" || hash == "#!" || hash == "#!/") {
            path = application.defaultCard.id;
        } else {
            path = hash.substr(3);
        }

        return path;
    }
    
    export function offCanvas(left?:string):void {
        if (typeof left == "undefined") {
            left = (main.style.left == "" || main.style.left == Transition.OFF_CANVASS_NONE)
                ? Transition.OFF_CANVASS_LEFT
                : Transition.OFF_CANVASS_NONE;
        }
        
        // apply the style
        main.style.left = left;
    }
    
    /* Psuedo methods to mimic the interaction of the standard HTML Document */
    
    export function getElementById(id):Element {<commit_msg>add update prompt<commit_after>module Application {
    export var READY:string = "savvy-load";
}

module application {
    
    export var name:string = null;
    export var id:string = null;
    export var isCordova:boolean = false;
    export var version:string = null;
    
    export var cards:HTMLElement[] = [];
    export var header:HTMLElement = null;
    export var footer:HTMLElement = null;
    export var main:HTMLElement = null;
    export var defaultCard:HTMLElement = null;
    export var currentCard:HTMLElement = null;
    
    export function goto(path:string, transition:Transition = Transition.CUT, preventHistory:boolean = false):void {
        throw "application.goto has not been over-written. Is there a problem with the order that Savvy is built?";
    }
    
    export function getRoute():string {
        var hash:string = window.location.hash;
        var path:string;
        if(hash == "" || hash == "#" || hash == "#!" || hash == "#!/") {
            path = application.defaultCard.id;
        } else {
            path = hash.substr(3);
        }

        return path;
    }
    
    export function offCanvas(left?:string):void {
        if (typeof left == "undefined") {
            left = (main.style.left == "" || main.style.left == Transition.OFF_CANVASS_NONE)
                ? Transition.OFF_CANVASS_LEFT
                : Transition.OFF_CANVASS_NONE;
        }
        
        // apply the style
        main.style.left = left;
    }
    
    // offer update on application cache update
    if (window.applicationCache) {
        // error, checking, noupdate, downloading, progress, updateready, cached
        window.applicationCache.addEventListener("updateready", function () {
            var message:string = "A new version of "
                + (("string" == typeof application.name) ? application.name : "this application")
                + " is available. Do you want to update now?";
            var url:string = window.location.protocol + "//" + window.location.host + window.location.pathname;
            if (window.confirm(message)) window.location.replace(url);
        }, false);
    }
    
    /* Psuedo methods to mimic the interaction of the standard HTML Document */
    
    export function getElementById(id):Element {
{'fraction_non_alphanumeric': 0.10880829015544041, 'fraction_numerical': 0.0005181347150259067, 'mean_word_length': 2.3632404181184667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3371370', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1053, 'n_words': 288}