<commit_before>/*
 * routers.js defines the application routers which map URLs to application functions.
 */
define(function(require) {

	var $ = require('jquery');
	var Backbone = require('backbone');

	var Router = Backbone.Router.extend({
		routes: {
			"app/:id"     		: "_launchApp",
			"menu"        		: "show_menu",
			""								: "show_menu",
			'authentication/*'	: "show_auth"

		},
		launchApp: function(id, args, callback) {
			callback = callback || function() {};
			this.context.launchApp(id, args || {}, function(err, data) {
				if(err) { return callback(err); }
				this.navigate('app/' + id);
			}.bind(this));
		},
		_launchApp: function(id) {
			this.launchApp(id);
		},
		show_menu: function() {
			$('#waiting_container').hide();
			$('#mainContent').hide();
			this.context.appClientView.hide();
			this.context.closeApp();
			this.context.appMenuView.show();
			this.context.hideModalContainer();
			this.context.menuShown = true;
		},
		show_auth: function (){
			
			$.ajax({url: "authentication/logout", success: function(result){
        		console.log(result);
   			}});
			$('#mainContent').show();
		},
		loadView : function(view) {
		this.view && this.view.remove();
		this.view = view;
		},<commit_msg>notified if kicked out<commit_after>/*
 * routers.js defines the application routers which map URLs to application functions.
 */
define(function(require) {

	var $ = require('jquery');
	var Backbone = require('backbone');

	var Router = Backbone.Router.extend({
		routes: {
			"app/:id"     		: "_launchApp",
			"menu"        		: "show_menu",
			""					: "show_menu",
			"authentication(?message=:message)"	: "show_auth"

		},
		launchApp: function(id, args, callback) {
			callback = callback || function() {};
			this.context.launchApp(id, args || {}, function(err, data) {
				if(err) { return callback(err); }
				this.navigate('app/' + id);
			}.bind(this));
		},
		_launchApp: function(id) {
			this.launchApp(id);
		},
		show_menu: function() {
			$('#waiting_container').hide();
			$('#mainContent').hide();
			this.context.appClientView.hide();
			this.context.closeApp();
			this.context.appMenuView.show();
			this.context.hideModalContainer();
			this.context.menuShown = true;
		},
		show_auth: function (message){
			if (message){
				console.log(message);
				message.toString();
				var par = message.replace(/-/g, ' ');
				console.log(par);
				$('#add_err').html('<div class="error"> <i class="fa fa-exclamation-circle" aria-hidden="true"></i><span class="sr-only"> '+par+'</span></div>');
				$('#add_err').show();

			}
			
			$.ajax({url: "authentication/logout", success: function(result){
        		console.log(result);
   			}});
			$('#mainContent').show();
		},
		loadView : function(view) {
		this.view && this.view.remove();
		this.view = view;
		},
{'fraction_non_alphanumeric': 0.1936056838365897, 'fraction_numerical': 0.0, 'mean_word_length': 3.441640378548896, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3077925', 'n_tokens_mistral': 1103, 'n_tokens_neox': 946, 'n_words': 167}