diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 438fc63f..e6d9ce19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,12 +24,10 @@ jobs: if: github.ref == 'refs/heads/stable' - name: Set up environment variables for stable deployment run: | - echo 'GA_ID=UA-76299550-2' >> "$GITHUB_ENV" echo 'SENTRY_ENV=stable' >> "$GITHUB_ENV" if: github.ref == 'refs/heads/stable' - name: Set up environment variables for devel deployment run: | - echo 'GA_ID=UA-76299550-3' >> "$GITHUB_ENV" echo 'SENTRY_ENV=devel' >> "$GITHUB_ENV" if: github.ref == 'refs/heads/master' - name: Build diff --git a/build.js b/build.js index f866a39f..ea22fbfb 100644 --- a/build.js +++ b/build.js @@ -1,21 +1,7 @@ const { readFileSync, writeFileSync } = require("fs"); const { exec } = require("child_process"); -const { GA_ID, SENTRY_DSN, SENTRY_ENV } = process.env; - -const GA_TEMPLATE = GA_ID ? ` - - - -` : ""; +const { SENTRY_DSN, SENTRY_ENV } = process.env; const SENTRY_TEMPLATE = SENTRY_DSN && SENTRY_ENV ? ` @@ -64,7 +50,7 @@ function formatCommitDate(d) { async function main() { const { commitId, commitDate } = await fetchGitCommitInfo(); const scriptAppend = - SENTRY_TEMPLATE.replace("{{SENTRY_RELEASE}}", commitId) + GA_TEMPLATE; + SENTRY_TEMPLATE.replace("{{SENTRY_RELEASE}}", commitId); if (scriptAppend) { fileAction(outDir + "/index.html", html => appendAfter(html, "", scriptAppend) diff --git a/src/v1/app.errors.ts b/src/v1/app.errors.ts index 7d44a97c..35a14cd3 100644 --- a/src/v1/app.errors.ts +++ b/src/v1/app.errors.ts @@ -1,5 +1,5 @@ import { htmlescape } from "../utils"; -import { app, ga } from "./app"; +import { app } from "./app"; export class ErrorWindowHandler { lastErrWndSize = 100; // 34 @@ -18,8 +18,8 @@ export class ErrorWindowHandler { this.errorWnd.getElement().addClass("errorWindow"); } this.errorWnd.on("resize", () => this.lastErrWndSize = this.errorWnd.getElement().outerHeight()); - this.errorWnd.on("destroy", () => { ga("errorwnd", "destroy"); this.errorWnd = null; }); - this.errorWnd.on("close", () => { ga("errorwnd", "close"); this.errorWnd = null; }); + this.errorWnd.on("destroy", () => { this.errorWnd = null; }); + this.errorWnd.on("close", () => { this.errorWnd = null; }); this.errorWnd.getElement().empty().append($("
").html(htmlescape(errMsg).replace(/\n|\\n/g, "
"))); } @@ -46,4 +46,3 @@ export class ErrorWindowHandler { } } } - diff --git a/src/v1/app.files.ts b/src/v1/app.files.ts index d50e6852..5eadc296 100644 --- a/src/v1/app.files.ts +++ b/src/v1/app.files.ts @@ -1,7 +1,7 @@ import * as localforage from "localforage"; import dateFormat = require("dateformat"); -import { ga, app } from "./app"; +import { app } from "./app"; import { IJSTreeNode } from "./parsedToTree"; import { downloadFile, saveFile, openFilesWithDialog } from "../utils"; @@ -360,9 +360,6 @@ export function initFileTree() { }); }); - fileTreeCont.on("rename_node.jstree", () => ga("filetree", "rename")); - fileTreeCont.on("move_node.jstree", () => ga("filetree", "move")); - fileTreeCont.on("create_node.jstree rename_node.jstree delete_node.jstree move_node.jstree paste.jstree", saveTree); fileTreeCont.on("move_node.jstree", (e, data) => app.ui.fileTree.open_node(app.ui.fileTree.get_node(data.parent))); fileTreeCont.on("select_node.jstree", (e, selectNodeArgs) => { @@ -372,8 +369,6 @@ export function initFileTree() { var lastMultiSelectReport = 0; fileTreeCont.on("select_node.jstree", (e, args) => { - if (e.timeStamp - lastMultiSelectReport > 1000 && args.selected.length > 1) - ga("filetree", "multi_select"); lastMultiSelectReport = e.timeStamp; }); diff --git a/src/v1/app.ts b/src/v1/app.ts index fcc6ac73..ced910fd 100644 --- a/src/v1/app.ts +++ b/src/v1/app.ts @@ -19,12 +19,6 @@ import KaitaiStructCompiler = require("kaitai-struct-compiler"); $.jstree.defaults.core.force_text = true; -export function ga(category: string, action: string, label?: string, value?: number) { - console.log(`[GA Event] cat:${category} act:${action} lab:${label || ""}`); - if (typeof window["_ga"] !== "undefined") - window["_ga"]("send", "event", category, action, label, value); -} - const qs = {}; location.search.substr(1).split("&").map(x => x.split("=")).forEach(x => qs[x[0]] = x[1]); @@ -72,10 +66,8 @@ class AppController { compile(srcYamlFsItem: IFsItem, srcYaml: string, kslang: string, debug: true | false | "both"): Promise { return this.compilerService.compile(srcYamlFsItem, srcYaml, kslang, debug).then(result => { - ga("compile", "success"); return result; }, (error: CompilationError) => { - ga("compile", "error", `${error.type}: ${error.error}`); this.errors.handle(error.error); return Promise.reject(error); }); @@ -331,7 +323,4 @@ $(() => { }); kaitaiIde.app = app; - - precallHook(app.ui.layout.layout.constructor["__lm"].controls, "DragProxy", () => ga("layout", "window_drag")); - $("body").on("mousedown", ".lm_drag_handle", () => { ga("layout", "splitter_drag"); }); });