<commit_before>/**
 * @module Core
 */
define([
    'core/modules/GelatoDialogs',
    'core/modules/GelatoSidebars',
    'modules/Router'
], function(GelatoDialog, GelatoSidebar, Router) {

    /**
     * @class GelatoApplication
     * @extends Backbone.Model
     */
    var GelatoApplication = Backbone.Model.extend({
        /**
         * @property dialogs
         * @type {GelatoDialog}
         */
        dialogs: new GelatoDialog(),
        /**
         * @property router
         * @type {Router}
         */
        router: new Router(),
        /**
         * @property sidebars
         * @type {GelatoSidebar}
         */
        sidebars: new GelatoSidebar(),
        /**
         * @method getHeight
         * @returns {Number}
         */
        getHeight: function() {
            return $(window).height();
        },
        /**
         * @method getPlatform
         * @returns {String}
         */
        getPlatform: function() {
            return window.device ? window.device.platform : 'Desktop';
        },
        /**
         * @method getSetting
         * @param {String} name
         * @returns {String}
         */
        getSetting: function(name) {
            return JSON.parse(localStorage.getItem('application-' + name));
        },
        /**
         * @method getWidth
         * @returns {Number}
         */
        getWidth: function() {
            return $(window).width();
        },
        /**
         * @method isAndroid
         * @returns {Boolean}
         */
        isAndroid: function() {
            return this.getPlatform() === 'Android';
        },
        /**
         * @method isCordova
         * @returns {Boolean}
         */
        isCordova: function() {
            return location.protocol === 'file:';
        },
        /**
         * @method isIOS
         * @returns {Boolean}
         */
        isIOS: function() {
            return getPlatform() === 'iOS';
        },
        /**
         * @method isLandscape
         * @returns {Boolean}
         */
        isLandscape: function() {
            return this.getWidth() > this.getHeight();
        },
        /**
         * @method isPortrait
         * @returns {Boolean}
         */
        isPortrait: function() {
            return this.getWidth() <= this.getHeight();
        },
        /**
         * @method reload
         */
        reload: function() {
            location.href = '';
        },
        /**
         * @method removeSetting
         * @param {String} name
         */
        removeSetting: function(name) {
            localStorage.removeItem('application-' + name);
        },
        /**
         * @method setSetting
         * @param {String} name
         * @param {Boolean|Object|String} value
         */
        setSetting: function(name, value) {
            localStorage.setItem('application-' + name, JSON.stringify(value));
        },
        /**
         * @method start
         * @returns {GelatoApplication}
         */
        start: function() {
            this.router.start();
            return this;
        }
    });

    return GelatoApplication;

});<commit_msg>Added an application method for checking for development.<commit_after>/**
 * @module Core
 */
define([
    'core/modules/GelatoDialogs',
    'core/modules/GelatoSidebars',
    'modules/Router'
], function(GelatoDialog, GelatoSidebar, Router) {

    /**
     * @class GelatoApplication
     * @extends Backbone.Model
     */
    var GelatoApplication = Backbone.Model.extend({
        /**
         * @property dialogs
         * @type {GelatoDialog}
         */
        dialogs: new GelatoDialog(),
        /**
         * @property router
         * @type {Router}
         */
        router: new Router(),
        /**
         * @property sidebars
         * @type {GelatoSidebar}
         */
        sidebars: new GelatoSidebar(),
        /**
         * @method getHeight
         * @returns {Number}
         */
        getHeight: function() {
            return $(window).height();
        },
        /**
         * @method getPlatform
         * @returns {String}
         */
        getPlatform: function() {
            return window.device ? window.device.platform : 'Desktop';
        },
        /**
         * @method getSetting
         * @param {String} name
         * @returns {String}
         */
        getSetting: function(name) {
            return JSON.parse(localStorage.getItem('application-' + name));
        },
        /**
         * @method getWidth
         * @returns {Number}
         */
        getWidth: function() {
            return $(window).width();
        },
        /**
         * @method isAndroid
         * @returns {Boolean}
         */
        isAndroid: function() {
            return this.getPlatform() === 'Android';
        },
        /**
         * @method isDevelopment
         * @returns {Boolean}
         */
        isDevelopment: function() {
            return location.href.indexOf('http://dev.')> -1;
        },
        /**
         * @method isCordova
         * @returns {Boolean}
         */
        isCordova: function() {
            return location.protocol === 'file:';
        },
        /**
         * @method isIOS
         * @returns {Boolean}
         */
        isIOS: function() {
            return getPlatform() === 'iOS';
        },
        /**
         * @method isLandscape
         * @returns {Boolean}
         */
        isLandscape: function() {
            return this.getWidth() > this.getHeight();
        },
        /**
         * @method isPortrait
         * @returns {Boolean}
         */
        isPortrait: function() {
            return this.getWidth() <= this.getHeight();
        },
        /**
         * @method reload
         */
        reload: function() {
            location.href = '';
        },
        /**
         * @method removeSetting
         * @param {String} name
         */
        removeSetting: function(name) {
            localStorage.removeItem('application-' + name);
        },
        /**
         * @method setSetting
         * @param {String} name
         * @param {Boolean|Object|String} value
         */
        setSetting: function(name, value) {
            localStorage.setItem('application-' + name, JSON.stringify(value));
        },
        /**
         * @method start
         * @returns {GelatoApplication}
         */
        start: function() {
            this.router.start();
            return this;
        }
    });

    return GelatoApplication;

});
{'fraction_non_alphanumeric': 0.13653699466056446, 'fraction_numerical': 0.00015255530129672007, 'mean_word_length': 1.335589597434984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3089494', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1720, 'n_words': 336}