<commit_before><!doctype html>
<html>
<head>
    <title>Gil Eats</title>
    <meta charset="UTF-8">
    <link href="https://fonts.googleapis.com/css?family=Indie+Flower" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <script src="js/utils.js"></script>
</head>
<body>

    <!-- Page Header -->
    <header class="page-header">
        <div class="container">
            <nav>
                <a href="https://vsoch.github.io/gileats">
                    <span style="position:absolute; margin-left:500px" class="code">Gil Eats</span></a>
                    <img src="img/gil.png" class="logo" />
                </a>
            </nav>
        </div>
    </header>

        <!-- Map with places - everyone always sees this!-->
        <div id="gmap" class="contact-map"></div>

        <div class="container main">

            <!-- Show the Add Eats button if not authenticated -->
            <div id="pre-auth-section" style="display:none;">
                <a href="" id="authlink" class="button">Add Eats</a>
                <span class="info">This will allow upload to your Dropbox, but it won't render on the map unless you change the code... this is Gil's Eats!</span>
            </div>

        </div>

        <!-- User sees this section after authentication, to add a new place -->
        <div id="authed-section" style="display:none;">

        <div class="form">
            <form class="register-form rating-form" onSubmit="return uploadFiles()">
                <!-- Restaurant and location search-->
                <input id="address-input" class="controls" type="text" placeholder="Enter a location">
                <input type="hidden" placeholder="location" id="location"/>
                <input type="text" placeholder="date" id="date"/>

                <!--Interactive Stars!-->
                <fieldset class="form-group">
                    <legend class="form-legend">Rating:</legend>
                        <div class="form-item">
                            <input id="rating-5" name="rating" type="radio" value="5" />
                            <label for="rating-5" data-value="5">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">5</span>
                            </label>
                            <input id="rating-4" name="rating" type="radio" value="4" />
                            <label for="rating-4" data-value="4">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">4</span>
                            </label>
                            <input id="rating-3" name="rating" type="radio" value="3" />
                            <label for="rating-3" data-value="3">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">3</span>
                            </label>
                            <input id="rating-2" name="rating" type="radio" value="2" />
                            <label for="rating-2" data-value="2">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">2</span>
                            </label>
                            <input id="rating-1" name="rating" type="radio" value="1" />
                            <label for="rating-1" data-value="1">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">1</span>
                            </label>
                        </div>
                    </fieldset>

                <input type="textarea" placeholder="review" id="review"/>
                <input type="hidden" id="access-token" placeholder="Access token" />
                <input type="hidden" id="url" placeholder="url for database" />
                <input type="file" id="file-upload" placeholder="picture"/>
                <button type="submit">nomnom</button> 

                <!-- A place to show the status of the upload -->
                <h2 id="results"></h2>
            </form>
         </div>
      </div>

  <script src="js/jquery.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

  <!-- Google maps API, note that we include Places library -->
  <script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyDhmVSj7xyJsbfI6CmG4AwSa8AKiA7_VaY&libraries=places"></script>
  <script type="text/javascript" src="js/gmaps.js"></script>
  <script type="text/javascript" src="js/eats.js"></script>

  <script>


    /* Register a service worker for caching files
       Commented out for now so the cache isn't active 
    if ('serviceWorker' in navigator) {
        navigator.serviceWorker.register('sw.js').then(function(registration) {
            // Registration was successful
            console.log('ServiceWorker registration successful with scope: ', registration.scope);

       }).catch(function(err) {
           // registration failed :(
           console.log('ServiceWorker registration failed: ', err);
     });
    }*/
    
    function getCookieToken(cookiename) {
        cookiename = cookiename || 'gileats';
        return $.cookie(cookiename);    
     }

    // Parses the url and gets the access token if it is in the urls hash
    function getAccessToken() {
        // First check to see if we have a cookie token
        if (!!getCookieToken()) {

            // Does the url have a token?
            var has_token = !!utils.parseQueryString(window.location.hash).access_token;
            
            // If we don't have a token, return False so the user authenticates
            if (!has_token) {
                return has_token;
            } else {

               // If we do, the user has authenticated but it's not set yet as a cookie
               var access_token = utils.parseQueryString(window.location.hash).access_token;

               // If gileats folder doesn't exist, create it
               createFolder('','gileats',access_token) // this is a promise
               .then(function(response) {
                   // Set the access_token in the gileats cookie
                   $.cookie("gileats",access_token);              
        
                   // Get a shared link to the database
                   getSharedLink('/gileats/db.json',access_token)
                   .then(function(url){
                       $.cookie("url",url);
                   });


                }); 
         }
       
       // At this point, if we haven't returned false, we can return the cookie that was set
       return getCookieToken();
       }
    }
    // If the user was just redirected from authenticating, the urls hash will
    // contain the access token.
    function isAuthenticated() { 
        return !!getAccessToken();
    }<commit_msg>trying changing sdk address to be same as domain<commit_after><!doctype html>
<html>
<head>
    <title>Gil Eats</title>
    <meta charset="UTF-8">
    <link href="https://fonts.googleapis.com/css?family=Indie+Flower" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <script src="js/Dropbox-sdk.min.js"></script>
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <script src="js/utils.js"></script>
</head>
<body>

    <!-- Page Header -->
    <header class="page-header">
        <div class="container">
            <nav>
                <a href="https://vsoch.github.io/gileats">
                    <span style="position:absolute; margin-left:500px" class="code">Gil Eats</span>
                    <img src="img/gil.png" class="logo" />
                </a>
            </nav>
        </div>
    </header>

        <!-- Map with places - everyone always sees this!-->
        <div id="gmap" class="contact-map"></div>

        <div class="container main">

            <!-- Show the Add Eats button if not authenticated -->
            <div id="pre-auth-section" style="display:none;">
                <a href="" id="authlink" class="button">Add Eats</a>
                <span class="info">This will allow upload to your Dropbox, but it won't render on the map unless you change the code... this is Gil's Eats!</span>
            </div>

        </div>

        <!-- User sees this section after authentication, to add a new place -->
        <div id="authed-section" style="display:none;">

        <div class="form">
            <form class="register-form rating-form" onSubmit="return uploadFiles()">
                <!-- Restaurant and location search-->
                <input id="address-input" class="controls" type="text" placeholder="Enter a location">
                <input type="hidden" placeholder="location" id="location"/>
                <input type="text" placeholder="date" id="date"/>

                <!--Interactive Stars!-->
                <fieldset class="form-group">
                    <legend class="form-legend">Rating:</legend>
                        <div class="form-item">
                            <input id="rating-5" name="rating" type="radio" value="5" />
                            <label for="rating-5" data-value="5">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">5</span>
                            </label>
                            <input id="rating-4" name="rating" type="radio" value="4" />
                            <label for="rating-4" data-value="4">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">4</span>
                            </label>
                            <input id="rating-3" name="rating" type="radio" value="3" />
                            <label for="rating-3" data-value="3">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">3</span>
                            </label>
                            <input id="rating-2" name="rating" type="radio" value="2" />
                            <label for="rating-2" data-value="2">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">2</span>
                            </label>
                            <input id="rating-1" name="rating" type="radio" value="1" />
                            <label for="rating-1" data-value="1">
                                <span class="rating-star">
                                    <i class="fa fa-star-o"></i>
                                    <i class="fa fa-star"></i>
                                </span>
                                <span class="ir">1</span>
                            </label>
                        </div>
                    </fieldset>

                <input type="textarea" placeholder="review" id="review"/>
                <input type="hidden" id="access-token" placeholder="Access token" />
                <input type="hidden" id="url" placeholder="url for database" />
                <input type="file" id="file-upload" placeholder="picture"/>
                <button type="submit">nomnom</button> 

                <!-- A place to show the status of the upload -->
                <h2 id="results"></h2>
            </form>
         </div>
      </div>

  <script src="js/jquery.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

  <!-- Google maps API, note that we include Places library -->
  <script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyDhmVSj7xyJsbfI6CmG4AwSa8AKiA7_VaY&libraries=places"></script>
  <script type="text/javascript" src="js/gmaps.js"></script>
  <script type="text/javascript" src="js/eats.js"></script>

  <script>


    /* Register a service worker for caching files
       Commented out for now so the cache isn't active 
    if ('serviceWorker' in navigator) {
        navigator.serviceWorker.register('sw.js').then(function(registration) {
            // Registration was successful
            console.log('ServiceWorker registration successful with scope: ', registration.scope);

       }).catch(function(err) {
           // registration failed :(
           console.log('ServiceWorker registration failed: ', err);
     });
    }*/
    
    function getCookieToken(cookiename) {
        cookiename = cookiename || 'gileats';
        return $.cookie(cookiename);    
     }

    // Parses the url and gets the access token if it is in the urls hash
    function getAccessToken() {

        // First check to see if we have a cookie token
        if (!getCookieToken()) {

            // Does the url have a token?
            var has_token = !!utils.parseQueryString(window.location.hash).access_token;
            
            // If we don't have a token, return False so the user authenticates
            if (!has_token) {

                return has_token;

            } else {

               // If we do, the user has authenticated but it's not set yet as a cookie
               var access_token = utils.parseQueryString(window.location.hash).access_token;

               // If gileats folder doesn't exist, create it
               createFolder('','gileats',access_token) // this is a promise
               .then(function(response) {
                   // Set the access_token in the gileats cookie
                   $.cookie("gileats",access_token);              
        
                   // Get a shared link to the database
                   getSharedLink('/gileats/db.json',access_token)
                   .then(function(url){
                       $.cookie("url",url);
                   });


                }); 
         }
       
       // At this point, if we haven't returned false, we can return the cookie that was set
       return getCookieToken();
       }
    }
    // If the user was just redirected from authenticating, the urls hash will
    // contain the access token.
    function isAuthenticated() { 
        return !!getAccessToken();
    }
{'fraction_non_alphanumeric': 0.13567236700952862, 'fraction_numerical': 0.005300687827349025, 'mean_word_length': 1.406316428788339, 'pattern_counts': {'":': 0, '<': 270, '<?xml version=': 0, '>': 270, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5466089', 'n_tokens_mistral': 4235, 'n_tokens_neox': 3988, 'n_words': 994}