<commit_before>/**
 * Prepros
 * (c) <NAME>
 * <EMAIL>
 * License: MIT
 */

/*jshint browser: true, node: true*/
/*global prepros, $, _ */
prepros.factory('utils', function () {

	'use strict';

	var md5 = require('MD5');

	function id(string){

		return md5(string.toLowerCase()).substr(8,8);
	}

    //Shows loading overlay
    function showLoading(){

        $('body').append('<div class="loading-overlay"><div class="container"><div class="loading-icon icomoon-spinner"></div></div></div>');
    }

    //Hide loading animation
    function hideLoading(){

        _.delay(function(){
            $('body .loading-overlay').fadeOut(200, function(){
                $(this).remove();
            });
        }, 200);
    }

    //Open Browser
    function openBrowser(url){

        require('child_process').spawn('explorer', [ url ], {detached: true});

    }

    var utils =  {
        id: id,
        showLoading: showLoading,
        hideLoading: hideLoading,
        openBrowser: openBrowser
    };
<commit_msg>Open browser with API<commit_after>/**
 * Prepros
 * (c) <NAME>
 * <EMAIL>
 * License: MIT
 */

/*jshint browser: true, node: true*/
/*global prepros, $, _ */
prepros.factory('utils', function () {

	'use strict';

	var md5 = require('MD5');

	function id(string){

		return md5(string.toLowerCase()).substr(8,8);
	}

    //Shows loading overlay
    function showLoading(){

        $('body').append('<div class="loading-overlay"><div class="container"><div class="loading-icon icomoon-spinner"></div></div></div>');
    }

    //Hide loading animation
    function hideLoading(){

        _.delay(function(){
            $('body .loading-overlay').fadeOut(200, function(){
                $(this).remove();
            });
        }, 200);
    }

    //Open Browser
    function openBrowser(url){

        require('nw.gui').Shell.openExternal(url);

    }

    var utils =  {
        id: id,
        showLoading: showLoading,
        hideLoading: hideLoading,
        openBrowser: openBrowser
    };

{'fraction_non_alphanumeric': 0.17457962413452027, 'fraction_numerical': 0.010880316518298714, 'mean_word_length': 2.5182608695652173, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '334673', 'n_tokens_mistral': 647, 'n_tokens_neox': 607, 'n_words': 128}