<commit_before>/* global require, module */

var exec = require("cordova/exec"),
	channel = require('cordova/channel'),
	utils = require('cordova/utils');

channel.createSticky('onAppUtilsReady');

// tell cordova channel to wait on the AppUtilsReady event
channel.waitForInitialization('onAppUtilsReady');

var AppUtils = function () {
	var me = this;

	me.name = "AppUtils";
	me.version = "0.1.0";

	channel.onCordovaReady.subscribe(function () {
		me.BundleInfo(function (info) {
			me.info = info;
			channel.onAppUtilsReady.fire();
		}, function (e) {
			me.info = false;
			utils.alert("[ERROR] Error initializing Cordova: " + e);
		});
	});

};

// IdleTimer
AppUtils.prototype.IdleTimer = {
	enable: function (onSuccess, onError) {
		if (device.platform == DEVICE_TYPE_ANDROID)
                        return;

		var options = {
			"action": "enable"
		};
		exec(onSuccess, onError, "AppUtils", "IdleTimer", [options]);
	},
	disable: function (onSuccess, onError) {
		if (device.platform == DEVICE_TYPE_ANDROID)
 			return;

		var options = {
			"action": "disable"
		};
		exec(onSuccess, onError, "AppUtils", "IdleTimer", [options]);
	},
	getStatus: function (onSuccess) {
		if (device.platform == DEVICE_TYPE_ANDROID)
                        return;

		var options = {
			"action": "status"
		};
		exec(onSuccess, null, "AppUtils", "IdleTimer", [options]);
	}
};

// BundleInfo
AppUtils.prototype.BundleInfo = function (onSuccess) {
	exec(onSuccess, null, "AppUtils", "BundleInfo", []);
};

AppUtils.prototype.DeviceInfo = function(onSuccess) {
	exec(onSuccess, null, "AppUtils", "DeviceInfo", []);
}

// OpenWith
AppUtils.prototype.OpenWith = function (onSuccess, onError, options) {
	exec(onSuccess, onError, "AppUtils", "OpenWith", [options]);
};

// SocialShare
AppUtils.prototype.SocialShare = function (onSuccess, onError, options) {
	exec(onSuccess, onError, "AppUtils", "SocialShare", [options]);
};

module.exports = new AppUtils();
<commit_msg>undefined constants<commit_after>/* global require, module */

var DEVICE_PLATFORM_ANDROID = 'Android';
var DEVICE_PLATFORM_IOS = 'iOS';

var exec = require("cordova/exec"),
	channel = require('cordova/channel'),
	utils = require('cordova/utils');

channel.createSticky('onAppUtilsReady');

// tell cordova channel to wait on the AppUtilsReady event
channel.waitForInitialization('onAppUtilsReady');

var AppUtils = function () {
	var me = this;

	me.name = "AppUtils";
	me.version = "0.1.0";

	channel.onCordovaReady.subscribe(function () {
		me.BundleInfo(function (info) {
			me.info = info;
			channel.onAppUtilsReady.fire();
		}, function (e) {
			me.info = false;
			utils.alert("[ERROR] Error initializing Cordova: " + e);
		});
	});

};

// IdleTimer
AppUtils.prototype.IdleTimer = {
	enable: function (onSuccess, onError) {
		if (device.platform == DEVICE_PLATFORM_ANDROID)
                        return;

		var options = {
			"action": "enable"
		};
		exec(onSuccess, onError, "AppUtils", "IdleTimer", [options]);
	},
	disable: function (onSuccess, onError) {
		if (device.platform == DEVICE_PLATFORM_ANDROID)
 			return;

		var options = {
			"action": "disable"
		};
		exec(onSuccess, onError, "AppUtils", "IdleTimer", [options]);
	},
	getStatus: function (onSuccess) {
		if (device.platform == DEVICE_PLATFORM_ANDROID)
                        return;

		var options = {
			"action": "status"
		};
		exec(onSuccess, null, "AppUtils", "IdleTimer", [options]);
	}
};

// BundleInfo
AppUtils.prototype.BundleInfo = function (onSuccess) {
	exec(onSuccess, null, "AppUtils", "BundleInfo", []);
};

AppUtils.prototype.DeviceInfo = function(onSuccess) {
	exec(onSuccess, null, "AppUtils", "DeviceInfo", []);
}

// OpenWith
AppUtils.prototype.OpenWith = function (onSuccess, onError, options) {
	exec(onSuccess, onError, "AppUtils", "OpenWith", [options]);
};

// SocialShare
AppUtils.prototype.SocialShare = function (onSuccess, onError, options) {
	exec(onSuccess, onError, "AppUtils", "SocialShare", [options]);
};

module.exports = new AppUtils();

{'fraction_non_alphanumeric': 0.15866699825913952, 'fraction_numerical': 0.0014921661278288984, 'mean_word_length': 4.216601815823606, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, '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': '7172073', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1335, 'n_words': 283}