<commit_before>
/**
* Popup for telling user session is about to end
*
*/
enyo.ready(function() {
  enyo.kind({
    name: "Bootplate.SessionTimeoutDialog"
    , kind: "onyx.Popup"
    , centered: true
    , float: true
    , id: 'sessionTimeoutDialog'
    , style: "height:45%; width:45%; "
    , autoDismiss: false
    , published : {
        timeRemaining: 60000
        , checkInterval: 1000
        , intervalKey: ''
    }
    , handlers: {
        onCheckRemainingSessionTime: 'checkRemainingSessionTime'
    }
    , components:[
        {content:'Your session will end in 60 seconds.', name: "countDownText", style: "margin-top: 10%;margin-left: 20%;"}
        , { kind: "onyx.Button"
            , content: "Logout Now"
            , name: "logoutNow"
            , classes: "onyx-blue"
            , style: "margin-top: 10%;margin-left: 10%;"
            , ontap: 'logoutNow'
        }
        , { kind: "onyx.Button"
            , content: "Return to Session"
            , name: "continueSession"
            , classes: "onyx-blue"
            , style: "margin-top: 10%;margin-left: 30%;"
            , ontap: 'continueSession'
        }

    ]
    , focus: function() {
        this.inherited(arguments);
        // if timer still running don't allow hide
      console.log(this.intervalKey +":"+ this.timeRemaining +":" + this.timeRemaining > 0)
        if (this.intervalKey && this.timeRemaining > 0) this.show();
    }
    , startTimer: function() {
        this.timeRemaining = mvcApp.sessionTimeRemaining;
        if (this.intervalKey) clearInterval(this.intervalKey);
        this.intervalKey = setInterval(function(){ mvcApp.authView.waterfall('onCheckRemainingSessionTime'); }, this.checkInterval );
    }
    , checkRemainingSessionTime: function(inSender, inEvent) {
        this.timeRemaining -= this.checkInterval;
        var remainingSec =
        this.$.countDownText.setContent("Your session will end in " + (this.timeRemaining/1000) + " seconds.")
        if (this.timeRemaining <= 00000) {
            clearInterval(this.intervalKey);
            mvcApp.controllers.authController.logout();
            this.hide();
        }
    }
    , logoutNow: function(inSender, inEvent) {<commit_msg>Timeout warning dialog<commit_after>
/**
* Popup for telling user session is about to end
*
*/
enyo.ready(function() {
  enyo.kind({
    name: "Bootplate.SessionTimeoutDialog"
    , kind: "onyx.Popup"
    , centered: true
    , float: true
    , id: 'sessionTimeoutDialog'
    , style: "height:45%; width:45%; "
    , autoDismiss: false
    , published : {
        timeRemaining: 60000
        , checkInterval: 1000
        , intervalKey: ''
    }
    , handlers: {
        onCheckRemainingSessionTime: 'checkRemainingSessionTime'
    }
    , components:[
        {content:'Your session will end in 60 seconds.', name: "countDownText", style: "margin-top: 10%;margin-left: 20%;"}
        , { kind: "onyx.Button"
            , content: "Logout Now"
            , name: "logoutNow"
            , classes: "onyx-blue"
            , style: "margin-top: 10%;margin-left: 10%;"
            , ontap: 'logoutNow'
        }
        , { kind: "onyx.Button"
            , content: "Return to Session"
            , name: "continueSession"
            , classes: "onyx-blue"
            , style: "margin-top: 10%;margin-left: 30%;"
            , ontap: 'continueSession'
        }

    ]
    , startTimer: function() {
        this.timeRemaining = mvcApp.sessionTimeRemaining;
        if (this.intervalKey) clearInterval(this.intervalKey);
        this.intervalKey = setInterval(function(){ mvcApp.authView.waterfall('onCheckRemainingSessionTime'); }, this.checkInterval );
    }
    , checkRemainingSessionTime: function(inSender, inEvent) {
        this.timeRemaining -= this.checkInterval;
        var remainingSec =
        this.$.countDownText.setContent("Your session will end in " + (this.timeRemaining/1000) + " seconds.")
        if (this.timeRemaining <= 00000) {
            clearInterval(this.intervalKey);
            mvcApp.controllers.authController.logout();
            this.hide();
        }
    }
    , logoutNow: function(inSender, inEvent) {
{'fraction_non_alphanumeric': 0.13216598704725355, 'fraction_numerical': 0.017750059966418805, 'mean_word_length': 2.352090032154341, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7313522', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1239, 'n_words': 251}