<commit_before>// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', [
    'ionic',
    'ionic.service.core',
    'ionic.service.analytics',
    'starter.controllers',
    'starter.services',
    'controller.purchase',
    'service.twads',
    'service.push',
    'ionic-timepicker',
    'ngCordova'
])
    .run(function($ionicPlatform, Util, $rootScope, $location, WeatherInfo) {
        $ionicPlatform.ready(function() {

            if (navigator.splashscreen) {
                navigator.splashscreen.hide();
            }

            if (Util.isDebug()) {
                Util.ga.debugMode();
            }

            if (ionic.Platform.isIOS()) {
                Util.ga.startTrackerWithId('[GOOGLE_ANALYTICS_IOS_KEY]');
                if (window.applewatch) {
                    applewatch.init(function () {
                        console.log('Succeeded to initialize for apple-watch');
                    }, function (err) {
                        console.log('Failed to initialize apple-watch', err);
                    }, 'group.net.wizardfactory.todayweather');
                }
            } else if (ionic.Platform.isAndroid()) {
                Util.ga.startTrackerWithId('[GOOGLE_ANALYTICS_ANDROID_KEY]');
            }

            // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
            // for form inputs)
            if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
                cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
                cordova.plugins.Keyboard.disableScroll(true);

            }
        });

        $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState) {
            if (toState.name === 'tab.search') {
                $rootScope.viewColor = '#ec72a8';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#EC407A');
                }
            } else if (toState.name === 'tab.forecast') {
                if (fromState.name === '') {
                    var guideVersion = localStorage.getItem('guideVersion');
                    if (guideVersion === null || Util.guideVersion > Number(guideVersion)) {
                        $location.path('/guide');
                        return;
                    } else if (WeatherInfo.getEnabledCityCount() === 0) {
                        $location.path('/tab/search');
                        return;
                    }
                }

                $rootScope.viewColor = '#03A9F4';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#0288D1');
                }
            } else if (toState.name === 'tab.dailyforecast') {
                $rootScope.viewColor = '#00BCD4';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#0097A7');
                }
            } else if (toState.name === 'tab.setting') {
                $rootScope.viewColor = '#FFA726';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#FB8C00');
                }
            } else if (toState.name === 'guide') {
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#0288D1');
                }
            }
        });
    })

    .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider, $compileProvider, ionicTimePickerProvider) {

        //$compileProvider.debugInfoEnabled(Util.isDebug());
        $compileProvider.debugInfoEnabled(false);

        //add chrome-extension for chrome extension
        $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|file|ftp|mailto|chrome-extension|blob:chrome-extension):/);
        $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|file|ftp|mailto|chrome-extension|blob:chrome-extension):/);

        $compileProvider.directive('ngShortChart', function() {
            return {
                restrict: 'A',
                transclude: true,
                link: function (scope, iElement) {
                    var marginTop = 12;
                    var textTop = 5;
                    var margin = {top: marginTop, right: 0, bottom: 12, left: 0, textTop: textTop};
                    var width, height, x, y;
                    var svg, initLine, line;
                    var displayItemCount = 0;

                    //parent element의 heigt가 변경되면, svg에 있는 모든 element를 지우고, height를 변경 다시 그림.
                    //chart가 나오지 않는 경우에는 height가 0이므로 그때는 동작하지 않음.
                    //element height는 광고 제거,추가 그리고 시간별,요일별 로 변경될때 변경됨.
                    scope.$watch(function () {
                        return iElement[0].getBoundingClientRect().height;
                    }, function(newValue) {
                        if (newValue === 0 || newValue === height) {
                            return;
                        }
                        width = iElement[0].getBoundingClientRect().width;
                        height = iElement[0].getBoundingClientRect().height;

                        //0.9.1까지 displayItemCount가 없음.
                        displayItemCount = scope.timeChart[1].displayItemCount;

                        console.log('scope watch');
                        var shortTableHeight = scope.getShortTableHeight(displayItemCount);
                        margin.top = marginTop + shortTableHeight;
                        margin.textTop = textTop - shortTableHeight;

                        x = d3.scale.ordinal().rangeBands([margin.left, width - margin.right]);
                        y = d3.scale.linear().range([height - margin.bottom, margin.top]);

                        if (svg != undefined) {
                            svg.selectAll("*").remove();
                            svg.attr('height', height);
                        }
                        else {
                            svg = d3.select(iElement[0]).append('svg')
                                .attr('width', width)
                                .attr('height', height);
                        }

                        initLine = d3.svg.line()
                            .interpolate('linear')
                            .x(function (d, i) {
                                return x.rangeBand() * i + x.rangeBand() / 2;<commit_msg>빠진 파일 추가. app.js<commit_after>// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.services' is found in services.js
// 'starter.controllers' is found in controllers.js
angular.module('starter', [
    'ionic',
    'ionic.service.core',
    'ionic.service.analytics',
    'starter.controllers',
    'starter.services',
    'controller.purchase',
    'service.twads',
    'service.push',
    'ionic-timepicker',
    'ngCordova'
])
    .run(function($ionicPlatform, Util, $rootScope, $location, WeatherInfo) {
        $ionicPlatform.ready(function() {

            if (navigator.splashscreen) {
                navigator.splashscreen.hide();
            }

            if (Util.isDebug()) {
                Util.ga.debugMode();
            }

            if (ionic.Platform.isIOS()) {
                Util.ga.startTrackerWithId('[GOOGLE_ANALYTICS_IOS_KEY]');
                if (window.applewatch) {
                    applewatch.init(function () {
                        console.log('Succeeded to initialize for apple-watch');
                    }, function (err) {
                        console.log('Failed to initialize apple-watch', err);
                    }, 'group.net.wizardfactory.todayweather');
                }
            } else if (ionic.Platform.isAndroid()) {
                Util.ga.startTrackerWithId('[GOOGLE_ANALYTICS_ANDROID_KEY]');
            }

            // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
            // for form inputs)
            if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
                cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
                cordova.plugins.Keyboard.disableScroll(true);

            }
        });

        $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState) {
            if (toState.name === 'tab.search') {
                $rootScope.viewColor = '#ec72a8';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#EC407A');
                }
            } else if (toState.name === 'tab.forecast') {
                if (fromState.name === '') {
                    var guideVersion = localStorage.getItem('guideVersion');
                    if (guideVersion === null || Util.guideVersion > Number(guideVersion)) {
                        $location.path('/guide');
                        return;
                    } else if (WeatherInfo.getEnabledCityCount() === 0) {
                        $location.path('/tab/search');
                        return;
                    }
                }

                $rootScope.viewColor = '#03A9F4';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#0288D1');
                }
            } else if (toState.name === 'tab.dailyforecast') {
                $rootScope.viewColor = '#00BCD4';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#0097A7');
                }
            } else if (toState.name === 'tab.setting') {
                $rootScope.viewColor = '#FFA726';
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#FB8C00');
                }
            } else if (toState.name === 'guide') {
                if (window.StatusBar) {
                    StatusBar.backgroundColorByHexString('#0288D1');
                }
            }
        });
    })

    .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider, $compileProvider, ionicTimePickerProvider) {

        //$compileProvider.debugInfoEnabled(Util.isDebug());
        $compileProvider.debugInfoEnabled(false);

        //add chrome-extension for chrome extension
        $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|file|ftp|mailto|chrome-extension|blob:chrome-extension):/);
        $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|file|ftp|mailto|chrome-extension|blob:chrome-extension):/);

        $compileProvider.directive('ngShortChart', function() {
            return {
                restrict: 'A',
                transclude: true,
                link: function (scope, iElement) {
                    var marginTop = 12;
                    var textTop = 5;
                    var margin = {top: marginTop, right: 0, bottom: 12, left: 0, textTop: textTop};
                    var width, height, x, y;
                    var svg, initLine, line;
                    var displayItemCount = 0;

                    //parent element의 heigt가 변경되면, svg에 있는 모든 element를 지우고, height를 변경 다시 그림.
                    //chart가 나오지 않는 경우에는 height가 0이므로 그때는 동작하지 않음.
                    //element height는 광고 제거,추가 그리고 시간별,요일별 로 변경될때 변경됨.
                    scope.$watch(function () {
                        return iElement[0].getBoundingClientRect().height;
                    }, function(newValue) {
                        if (newValue === 0 || newValue === height) {
                            return;
                        }
                        width = iElement[0].getBoundingClientRect().width;
                        height = iElement[0].getBoundingClientRect().height;

                        //0.9.1까지 displayItemCount가 없음.
                        displayItemCount = scope.timeChart[1].displayItemCount;
                        if (displayItemCount == undefined || displayItemCount == 0) {
                            displayItemCount = 3;
                        }

                        console.log('scope watch');
                        var shortTableHeight = scope.getShortTableHeight(displayItemCount);
                        margin.top = marginTop + shortTableHeight;
                        margin.textTop = textTop - shortTableHeight;

                        x = d3.scale.ordinal().rangeBands([margin.left, width - margin.right]);
                        y = d3.scale.linear().range([height - margin.bottom, margin.top]);

                        if (svg != undefined) {
                            svg.selectAll("*").remove();
                            svg.attr('height', height);
                        }
                        else {
                            svg = d3.select(iElement[0]).append('svg')
                                .attr('width', width)
                                .attr('height', height);
                        }

                        initLine = d3.svg.line()
                            .interpolate('linear')
                            .x(function (d, i) {
                                return x.rangeBand() * i + x.rangeBand() / 2;
{'fraction_non_alphanumeric': 0.11353455239773812, 'fraction_numerical': 0.008812513769552765, 'mean_word_length': 1.4541358803387998, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5175640', 'n_tokens_mistral': 3775, 'n_tokens_neox': 3549, 'n_words': 679}