<commit_before>// load Google's JS API and setup the init function
google.load("gdata", "2.x");
google.setOnLoadCallback(main);


var contactsService = null;
var contactsServiceScope = 'https://www.google.com/m8/feeds';
var countryprefix = '';

/**
 * The init function that initializes everything
 */
function main() {
    var hdr = document.getElementById('header');

    if(google.accounts.user.checkLogin(contactsServiceScope)){
        // we're logged in already, create logout button
        var btn = document.createElement('button');
        btn.innerText = 'Switch Account';
        btn.onclick   = google.accounts.user.logout;
        hdr.innerHTML = '';
        hdr.appendChild(btn);

        // initialize the global contact service
        contactsService = new google.gdata.contacts.ContactsService('splitbrain.org-phonefix-1.0');

        // show the init screen
        startGUI();
    }else{
        // make a login button
        var btn = document.createElement('button');
        btn.innerText = 'Logout';
        btn.onclick   = function(){
            var token = google.accounts.user.login(contactsServiceScope);
        };
        hdr.innerHTML = '';
        hdr.appendChild(btn);
    }
}

function startGUI() {
    var out = document.getElementById('output');
    out.innerHTML = '<p><label for="countryprefix">Default Country Prefix: </label>'+
                    '<input type="text" id="countryprefix" value="+49" size="3" /></p>';
    var btn = document.createElement('button');
    btn.innerText = 'Load contacts and preview fixed contacts...';
    btn.onclick = function(){
        // set global prefix
        countryprefix = document.getElementById('countryprefix').value;

        // load the contacts
        loadContacts();
    }
    out.appendChild(btn);<commit_msg>fixed login button label<commit_after>// load Google's JS API and setup the init function
google.load("gdata", "2.x");
google.setOnLoadCallback(main);


var contactsService = null;
var contactsServiceScope = 'https://www.google.com/m8/feeds';
var countryprefix = '';

/**
 * The init function that initializes everything
 */
function main() {
    var hdr = document.getElementById('header');

    if(google.accounts.user.checkLogin(contactsServiceScope)){
        // we're logged in already, create logout button
        var btn = document.createElement('button');
        btn.innerText = 'Switch Account';
        btn.onclick   = google.accounts.user.logout;
        hdr.innerHTML = '';
        hdr.appendChild(btn);

        // initialize the global contact service
        contactsService = new google.gdata.contacts.ContactsService('splitbrain.org-phonefix-1.0');

        // show the init screen
        startGUI();
    }else{
        // make a login button
        var btn = document.createElement('button');
        btn.innerText = 'Login to Google Contacts';
        btn.onclick   = function(){
            var token = google.accounts.user.login(contactsServiceScope);
        };
        hdr.innerHTML = '';
        hdr.appendChild(btn);
    }
}

function startGUI() {
    var out = document.getElementById('output');
    out.innerHTML = '<p><label for="countryprefix">Default Country Prefix: </label>'+
                    '<input type="text" id="countryprefix" value="+49" size="3" /></p>';
    var btn = document.createElement('button');
    btn.innerText = 'Load contacts and preview fixed contacts...';
    btn.onclick = function(){
        // set global prefix
        countryprefix = document.getElementById('countryprefix').value;

        // load the contacts
        loadContacts();
    }
    out.appendChild(btn);
{'fraction_non_alphanumeric': 0.1325997248968363, 'fraction_numerical': 0.0038514442916093533, 'mean_word_length': 2.7600827300930715, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '5464916', 'n_tokens_mistral': 1011, 'n_tokens_neox': 964, 'n_words': 243}