<commit_before>import controllerModules from './controllers'
import directivesModules from './directives'
import servicesModules from './services'
import * as Controllers from './controller/index'
import * as HKEPC from '../data/config/hkepc'
import * as URLUtils from '../utils/url'
import {NativeChangeThemeRequest} from './bridge/NativeChangeThemeRequest'
import {NativeChangeFontSizeRequest} from './bridge/NativeChangeFontSizeRequest'
require('angulartics')

const moment = require('moment')
require('moment/locale/zh-tw');

// identify weather is proxy client before loading the angular app
const isProxied = URLUtils.isProxy()

function setupWebViewJavascriptBridge(callback) {
  if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
  if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
  window.WVJBCallbacks = [callback];
  var WVJBIframe = document.createElement('iframe');
  WVJBIframe.style.display = 'none';
  WVJBIframe.src = 'https://__bridge_loaded__';
  document.documentElement.appendChild(WVJBIframe);
  setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
}
// 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',
  'starter.controllers',
  'starter.services',
  'starter.directives',
  'ngToast',
  'ionicLazyLoad',
  'angulartics',
  require('angulartics-google-analytics'),
  'LocalForageModule',
  'rx',
  'ngFileUpload',
  'monospaced.elastic'
])
.run(function($rootScope,ngToast, $window) {
  window.moment = moment


  setupWebViewJavascriptBridge(function(bridge) {

    bridge.registerHandler('NATIVE_STORAGE_UPDATE', function(data, responseCallback) {
      switch (data.key){
        case "theme":
          $rootScope.$emit(NativeChangeThemeRequest.NAME, new NativeChangeThemeRequest(data.value))
          break
        case "fontSize":
          $rootScope.$emit(NativeChangeFontSizeRequest.NAME, new NativeChangeFontSizeRequest(data.value))
          break
        default:
          break
      }
    })<commit_msg>support tap native status bar and scroll to Top<commit_after>import controllerModules from './controllers'
import directivesModules from './directives'
import servicesModules from './services'
import * as Controllers from './controller/index'
import * as HKEPC from '../data/config/hkepc'
import * as URLUtils from '../utils/url'
import {NativeChangeThemeRequest} from './bridge/NativeChangeThemeRequest'
import {NativeChangeFontSizeRequest} from './bridge/NativeChangeFontSizeRequest'
require('angulartics')

const moment = require('moment')
require('moment/locale/zh-tw');

// identify weather is proxy client before loading the angular app
const isProxied = URLUtils.isProxy()

function setupWebViewJavascriptBridge(callback) {
  if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
  if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
  window.WVJBCallbacks = [callback];
  var WVJBIframe = document.createElement('iframe');
  WVJBIframe.style.display = 'none';
  WVJBIframe.src = 'https://__bridge_loaded__';
  document.documentElement.appendChild(WVJBIframe);
  setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
}
// 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',
  'starter.controllers',
  'starter.services',
  'starter.directives',
  'ngToast',
  'ionicLazyLoad',
  'angulartics',
  require('angulartics-google-analytics'),
  'LocalForageModule',
  'rx',
  'ngFileUpload',
  'monospaced.elastic'
])
.run(function($rootScope,ngToast, $window, $ionicScrollDelegate) {
  window.moment = moment

  setupWebViewJavascriptBridge(function(bridge) {

    bridge.registerHandler('NATIVE_STORAGE_UPDATE', function(data, responseCallback) {
      switch (data.key){
        case "theme":
          $rootScope.$emit(NativeChangeThemeRequest.NAME, new NativeChangeThemeRequest(data.value))
          break
        case "fontSize":
          $rootScope.$emit(NativeChangeFontSizeRequest.NAME, new NativeChangeFontSizeRequest(data.value))
          break
        default:
          break
      }
    })

    bridge.registerHandler('STATUS_BAR_DID_TAP', (data) => {
      $ionicScrollDelegate.scrollTo(0,0,true)
    })

{'fraction_non_alphanumeric': 0.11692307692307692, 'fraction_numerical': 0.0012307692307692308, 'mean_word_length': 4.689614935822637, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, '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': '1636200', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1407, 'n_words': 332}