<commit_before><!DOCTYPE html><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ page import="java.util.Map" %><%@ page import="com.rapid.core.*" %><%@ page import="com.rapid.server.filter.*" %><%@ page import="com.rapid.server.RapidRequest" %><%@ page import="com.rapid.security.SecurityAdapter" %><%

/*

Copyright (C) 2020 - <NAME> / Rapid Information Systems

<EMAIL>


This file is part of the Rapid Application Platform

Rapid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. The terms require you to include
the original copyright, and the license notice in all redistributions.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
in a file named "COPYING".  If not, see <http://www.gnu.org/licenses/>.

*/

//get the applications
Applications applications = (Applications) getServletContext().getAttribute("applications");
// get the rapid app
Application rapid = applications.get("rapid");
//get a rapid request
RapidRequest rapidRequest = new RapidRequest(request, rapid); 
%>
<html>
	<head>
	
		<title>Rapid - Welcome</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="icon" href="favicon.ico"></link>
		<link rel="stylesheet" type="text/css" href="styles/index.css"></link>
		<link rel='stylesheet' type='text/css' href='styles/fonts/fontawesome/css/font-awesome.css'></link>
		<script type='text/javascript' src='scripts/<%=com.rapid.server.Rapid.JQUERY%>'></script>
		<link rel="manifest" href="manifest.json">
		<script type="text/javascript">

if ('serviceWorker' in navigator) {
  console.log('CLIENT: service worker registration in progress.');
  navigator.serviceWorker.register('sw.js')
  .then(function() {
    console.log('CLIENT: service worker registration complete.');
  }).catch(function(error) {
    console.log('CLIENT: service worker registration failure : ' + error);
  });
} else {
  console.log('CLIENT: service worker is not supported.');
}

// JQuery is ready! 
$(document).ready( function() {	
	
	// find the div we're going to put the apps in
	var appsDiv = $("#apps");
	
	// load the apps
	$.ajax({
    	url: "~?action=getApps",
    	type: "POST",          
    	dataType: "json",    
    	data: "{}",
        error: function(server, status, error) { 
        	appsDiv.html(error); 
        },
        success: function(data) {
        	if (data && data.length > 0) {
        		
        		// build a list with links that the user has access to
        		var appHtml = "<ul>";
        		for (var i in data) {
        			var app = data[i];
        			appHtml += "<a href='" + app.id + "'" + (app.isCached ? " class='appCached'" : "") + " style='font-size:18px; font-weight:normal;'><li>" + app.title + "</li></a>";
        		}
        		appHtml += "</ul>";
        		appsDiv.html(appHtml);

        	} else {
        		appsDiv.html("<b>You do not have permission to use any applications</b>"); 
        	}   		       	
        }
	});
	
	if (!navigator.onLine) $(document.body).addClass("offline");
	
	var deferredPrompt;
	var addBtn = document.querySelector('.addButton');

	window.addEventListener('beforeinstallprompt', (e) => {

	  // Prevent Chrome 67 and earlier from automatically showing the prompt
	  e.preventDefault();
	  // Stash the event so it can be triggered later.
	  deferredPrompt = e;
	  // Update UI to notify the user they can add to home screen
	  addBtn.style.display = 'inline-block';

	  addBtn.addEventListener('click', (e) => {
	    // hide our user interface that shows our A2HS button
	    addBtn.style.display = 'none';
	    // Show the prompt
	    deferredPrompt.prompt();
	    // Wait for the user to respond to the prompt
	    deferredPrompt.userChoice.then((choiceResult) => {
	        if (choiceResult.outcome === 'accepted') {<commit_msg>index.jsp: Removed lambdas that broke IE.<commit_after><!DOCTYPE html><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ page import="java.util.Map" %><%@ page import="com.rapid.core.*" %><%@ page import="com.rapid.server.filter.*" %><%@ page import="com.rapid.server.RapidRequest" %><%@ page import="com.rapid.security.SecurityAdapter" %><%

/*

Copyright (C) 2020 - <NAME> / Rapid Information Systems

<EMAIL>


This file is part of the Rapid Application Platform

Rapid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. The terms require you to include
the original copyright, and the license notice in all redistributions.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
in a file named "COPYING".  If not, see <http://www.gnu.org/licenses/>.

*/

//get the applications
Applications applications = (Applications) getServletContext().getAttribute("applications");
// get the rapid app
Application rapid = applications.get("rapid");
//get a rapid request
RapidRequest rapidRequest = new RapidRequest(request, rapid); 
%>
<html>
	<head>
	
		<title>Rapid - Welcome</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="icon" href="favicon.ico"></link>
		<link rel="stylesheet" type="text/css" href="styles/index.css"></link>
		<link rel='stylesheet' type='text/css' href='styles/fonts/fontawesome/css/font-awesome.css'></link>
		<script type='text/javascript' src='scripts/<%=com.rapid.server.Rapid.JQUERY%>'></script>
		<link rel="manifest" href="manifest.json">
		<script type="text/javascript">

if ('serviceWorker' in navigator) {
  console.log('CLIENT: service worker registration in progress.');
  navigator.serviceWorker.register('sw.js')
  .then(function() {
    console.log('CLIENT: service worker registration complete.');
  }).catch(function(error) {
    console.log('CLIENT: service worker registration failure : ' + error);
  });
} else {
  console.log('CLIENT: service worker is not supported.');
}

// JQuery is ready! 
$(document).ready( function() {	
	
	// find the div we're going to put the apps in
	var appsDiv = $("#apps");
	
	// load the apps
	$.ajax({
    	url: "~?action=getApps",
    	type: "POST",          
    	dataType: "json",    
    	data: "{}",
        error: function(server, status, error) { 
        	appsDiv.html(error); 
        },
        success: function(data) {
        	if (data && data.length > 0) {
        		
        		// build a list with links that the user has access to
        		var appHtml = "<ul>";
        		for (var i in data) {
        			var app = data[i];
        			appHtml += "<a href='" + app.id + "'" + (app.isCached ? " class='appCached'" : "") + " style='font-size:18px; font-weight:normal;'><li>" + app.title + "</li></a>";
        		}
        		appHtml += "</ul>";
        		appsDiv.html(appHtml);

        	} else {
        		appsDiv.html("<b>You do not have permission to use any applications</b>"); 
        	}   		       	
        }
	});
	
	if (!navigator.onLine) document.body.classList.add("offline");
	
	var deferredPrompt;
	var addBtn = document.querySelector('.addButton');

	window.addEventListener('beforeinstallprompt', function(e) {

	  // Prevent Chrome 67 and earlier from automatically showing the prompt
	  e.preventDefault();
	  // Stash the event so it can be triggered later.
	  deferredPrompt = e;
	  // Update UI to notify the user they can add to home screen
	  addBtn.style.display = 'inline-block';

	  addBtn.addEventListener('click', function(e) {
	    // hide our user interface that shows our A2HS button
	    addBtn.style.display = 'none';
	    // Show the prompt
	    deferredPrompt.prompt();
	    // Wait for the user to respond to the prompt
	    deferredPrompt.userChoice.then(function(choiceResult) {
	        if (choiceResult.outcome === 'accepted') {
{'fraction_non_alphanumeric': 0.14121567275652075, 'fraction_numerical': 0.004136504653567736, 'mean_word_length': 3.4227642276422765, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2316179', 'n_tokens_mistral': 2730, 'n_tokens_neox': 2589, 'n_words': 799}