-
Notifications
You must be signed in to change notification settings - Fork 135
/
diff.diff
1504 lines (1484 loc) · 58.9 KB
/
diff.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
commit 1954a0b23f6a698804289aefa9dbe8d627ccba05
Author: Carey Hoffman <[email protected]>
Date: Tue Mar 3 16:46:53 2020 -0800
Remove analytics
diff --git a/Construct b/Construct
index 2b0b7b1de..b24b91e7b 100644
--- a/Construct
+++ b/Construct
@@ -458,7 +458,6 @@ Build(
"$build/modules/trackchanges/Conscript",
# CITODO: Enable when ready
#"$build/modules/zendframework/Conscript",
- "$build/modules/analytics/Conscript",
"$build/modules/commando/Conscript",
"$build/modules/scope_files/Conscript",
"$build/modules/scope_tools/Conscript",
diff --git a/src/chrome/komodo/content/sdk/logging.js b/src/chrome/komodo/content/sdk/logging.js
index 3b8e41fd2..1ce7d1df5 100644
--- a/src/chrome/komodo/content/sdk/logging.js
+++ b/src/chrome/komodo/content/sdk/logging.js
@@ -526,7 +526,7 @@ Logger.prototype.report = function(e, message, level = "EXCEPTION") {
}
],
user: {
- id: prefs.getString('analytics_ga_uid', "")
+ id: prefs.getString('analytics_ga_id', "")
}
}
]
diff --git a/src/chrome/komodo/content/startupWizard/startupWizard.js b/src/chrome/komodo/content/startupWizard/startupWizard.js
index 265a480c6..5491f5465 100644
--- a/src/chrome/komodo/content/startupWizard/startupWizard.js
+++ b/src/chrome/komodo/content/startupWizard/startupWizard.js
@@ -153,10 +153,6 @@ if (typeof window.startupWizard == "undefined")
fields.snippetBehavior.value("auto"); // This is hard to detect given the way this is currently stored
- fields.analytics = require("ko/ui/checkbox").create("Help make Komodo even better by providing anonymous statistics about your usage");
- fields.analytics.$element.addClass("fullwidth");
- fields.analytics.checked( prefs.getBoolean("analytics_enabled") );
-
fields.runTutorial = require("ko/ui/checkbox").create('Start the "Getting Started" Tutorial when I finish this wizard');
fields.runTutorial.$element.addClass("fullwidth");
fields.runTutorial.checked(true);
@@ -310,7 +306,6 @@ if (typeof window.startupWizard == "undefined")
var indentGroupbox = page.addGroupbox({caption: "Indentation"});
var autoGroupbox = page.addGroupbox({caption: "Automation"});
- var helpKomodoGroupbox = page.addGroupbox({caption: "Analytics (Attention!)"});
indentGroupbox.addRow([
require("ko/ui/label").create("Indentation Width: "),
@@ -327,25 +322,6 @@ if (typeof window.startupWizard == "undefined")
autoGroupbox.addRow(fields.showLineNumbers);
- helpKomodoGroupbox.addRow(fields.analytics);
-
- var textStyle = {attributes: { style: "width: 500px; display: inline-block; text-align: center; opacity: 0.7;" }};
- helpKomodoGroupbox.addRow([
- require("ko/ui/span").create(
- "Komodo tracks very basic non-identifiable user data (such as what features or languages are used). " +
- "This information is used to focus the development efforts for Komodo. " +
- "The analytics code is open source and can be inspected on github.",
- textStyle
- )
- ]);
-
- helpKomodoGroupbox.addRow([
- require("ko/ui/link").create("View Analytics Code", { attributes: {
- href: "https://github.com/Komodo/KomodoEdit/tree/master/src/modules/analytics",
- style: "width: 500px; display: inline-block; text-align: center;"
- } })
- ]);
-
return page;
};
@@ -476,7 +452,6 @@ if (typeof window.startupWizard == "undefined")
prefs.setBoolean("editSmartSoftCharacters", fields.softchars.checked());
prefs.setLong("tabWidth", fields.indentWidth.value());
prefs.setLong("indentWidth", fields.indentWidth.value());
- prefs.setBoolean("analytics_enabled", fields.analytics.checked());
prefs.setBoolean("enableAutoAbbreviations", true);
if (fields.snippetBehavior.value() == "auto")
diff --git a/src/components/koInitService.p.py b/src/components/koInitService.p.py
index 562e60447..c01b2cb55 100644
--- a/src/components/koInitService.p.py
+++ b/src/components/koInitService.p.py
@@ -560,7 +560,7 @@ class KoInitService(object):
"version": i.version,
"build": i.buildNumber,
"releaseStage": i.buildFlavour
- }, user = {"id": prefs.getString("analytics_ga_uid", "")})
+ }, user = {"id": prefs.getString("analytics_ga_id", "")})
# Hook it up to our loggers
logger = logging.getLogger()
diff --git a/src/install/wix/feature-core.ini b/src/install/wix/feature-core.ini
index df3313f77..fede0fa34 100644
--- a/src/install/wix/feature-core.ini
+++ b/src/install/wix/feature-core.ini
@@ -1884,7 +1884,6 @@ feature-core/INSTALLDIR/lib/sdk/udl/mustache/js2mustache.udl
feature-core/INSTALLDIR/lib/sdk/udl/mustache/mustache2html.udl
feature-core/INSTALLDIR/lib/sdk/udl/mustache/mustachelex.udl
feature-core/INSTALLDIR/lib/sdk/udl/r-mainlex.udl
-feature-core/INSTALLDIR/lib/mozilla/extensions/[email protected]
feature-core/INSTALLDIR/lib/mozilla/extensions/[email protected]
feature-core/INSTALLDIR/lib/mozilla/extensions/[email protected]
feature-core/INSTALLDIR/lib/mozilla/extensions/[email protected]/chrome.manifest
diff --git a/src/modules/analytics/Conscript b/src/modules/analytics/Conscript
deleted file mode 100644
index 6643042a6..000000000
--- a/src/modules/analytics/Conscript
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/local/bin/perl
-# Copyright (c) 2010 ActiveState Software Inc.
-# See the file LICENSE.txt for licensing information.
-
-Import(
- 'cons',
- 'platform',
- 'productType',
- 'buildFlavour',
- 'sdkDir',
- 'idlExportDir',
- 'build',
- 'mozBin',
- 'unsiloedPythonExe',
- 'mozVersion',
- 'mozExtensionDir',
- 'mozIdlIncludePath',
-);
-
-$cons->KoExt("koinstall --packed");
-
-# For quick development, comment out the "KoExt" call above and
-# use the following. The first time this is run, it will setup the
-# appropriate extension link. Then you need to *manually* do
-# a local "koext" dev build via:
-# python ../../sdk/bin/koext.py build --dev
-# You need to re-run "koext build --dev" every time you change or add
-# files that are built, e.g.: preprocessed files, idl files. However for
-# files that are not built -- e.g. XUL, CSS, JS, Python -- you don't
-# need to build at all, just re-start Komodo.
-#
-#$cons->KoExtSourceDevInstall();
diff --git a/src/modules/analytics/chrome.p.manifest b/src/modules/analytics/chrome.p.manifest
deleted file mode 100644
index 1bdb8962a..000000000
--- a/src/modules/analytics/chrome.p.manifest
+++ /dev/null
@@ -1,9 +0,0 @@
-# #if MODE == "dev"
-content analytics content/
-locale analytics en-US locale/en-US/
-# #else
-content analytics jar:analytics.jar!/content/
-locale analytics en-US jar:analytics.jar!/locale/en-US/
-# #endif
-
-overlay chrome://komodo/content/komodo.xul chrome://analytics/content/overlay.xul
diff --git a/src/modules/analytics/content/analytics.js b/src/modules/analytics/content/analytics.js
deleted file mode 100644
index 59438531c..000000000
--- a/src/modules/analytics/content/analytics.js
+++ /dev/null
@@ -1,553 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-if (typeof(ko) == 'undefined')
-{
- var ko = require("ko/windows").getMain().ko;
-}
-
-ko.analytics = new function()
-{
-
- const CAT_FILE_METRIC = 'File Metrics';
- const CAT_INSTALL_METRIC = 'Install Metrics';
- const CAT_SYSTEM_METRIC = 'System Metrics';
- const CAT_PREF_METRIC = 'Pref Metrics';
- const CAT_BUTTONS_METRIC = 'Button Metrics';
- const CAT_WIDGET_METRIC = 'Widget Metrics';
-
- const DIM_PRODUCT = 'dimension1';
- const DIM_VERSION = 'dimension2';
- const DIM_BUILD = 'dimension3';
- const DIM_BUILDTYPE = 'dimension4';
-
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
- const { logging } = Cu.import("chrome://komodo/content/library/logging.js", {});
- const { DownloadUtils } = Cu.import("resource://gre/modules/DownloadUtils.jsm", {});
-
- var prefs = Cc['@activestate.com/koPrefService;1'].getService(Ci.koIPrefService).prefs;
-
- var log = logging.getLogger('analytics');
- //log.setLevel(10);
-
- var sectionRegex = /^[a-z]*\:\//i;
-
- /**
- * Constructor
- */
- this.init = () =>
- {
- //this.debug();
-
- // Retrieve unique user id
- var firstRun = false;
- var uid = prefs.getString('analytics_ga_uid', '');
- if (uid == '')
- {
- var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
- uid = new String(uuidGenerator.generateUUID());
- uid = uid.substr(1).substr(0,uid.length-2);
- prefs.setStringPref('analytics_ga_uid', uid);
- firstRun = true;
- }
-
- if ( ! prefs.getBoolean('analytics_enabled', false))
- {
- return;
- }
-
- // Init Ganalytics
- this._getProxy().ga_initialize();
-
- this._proxyGa('create', prefs.getStringPref('analytics_ga_id'), {
- 'cookieDomain': 'activestate.com', // gotta use something
- 'clientId': uid
- });
- this._proxyGa('set', 'checkProtocolTask', function(){});
- this._proxyGa('set', 'checkStorageTask', function(){});
-
- // Init DeskMetrics
- this._proxyDm('start', { appId: prefs.getString("analytics_deskmetrics_id") });
-
- // Set custom dimensions
- var infoSvc = Cc["@activestate.com/koInfoService;1"].getService(Ci.koIInfoService);
-
- this.setGaProperty(DIM_PRODUCT, infoSvc.productType);
- this.setGaProperty(DIM_VERSION, infoSvc.version);
- this.setGaProperty(DIM_BUILD, infoSvc.buildNumber);
- this.setGaProperty(DIM_BUILDTYPE, infoSvc.buildType);
-
- this.setDmProperty("client_uid", uid);
- this.setDmProperty("tracking_id", [infoSvc.version, infoSvc.buildType].join("_"));
- this.setDmProperty("sub_id", infoSvc.buildType);
- this.setDmProperty("ko_version", infoSvc.version);
- this.setDmProperty("ko_build", infoSvc.buildNumber);
- this.setDmProperty("ko_type", infoSvc.buildType);
-
- this.trackDmEvent("launch");
-
- // Track installs / upgrades
- var lastVersion = prefs.getString('analyticsLastVersion', '');
- if (lastVersion != infoSvc.version)
- {
- prefs.setStringPref('analyticsLastVersion', infoSvc.version);
- if (lastVersion == '')
- {
- this.trackGaEvent(CAT_INSTALL_METRIC, "Fresh Install", infoSvc.version);
- this.trackDmEvent("install", {state: "succeeded"});
- }
- else
- {
- this.trackGaEvent(CAT_INSTALL_METRIC, "Update", infoSvc.version);
- this.trackDmEvent("ko_updated", 1);
-
- this.trackGaEvent(CAT_INSTALL_METRIC, "Install", "from " + lastVersion + " to " + infoSvc.version);
- this.trackGaEvent("ko_updated_from", lastVersion);
- }
- }
-
- // Track system info, don't want to waste dimensions on this
- var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
- var memSize = Math.round(sysInfo.getPropertyAsInt64("memsize") / 1073741824, 2);
- var cpucount = sysInfo.getPropertyAsInt32("cpucount");
-
- if (firstRun)
- {
- this.trackGaEvent(CAT_SYSTEM_METRIC, "memory", memSize, memSize);
- this.trackGaEvent(CAT_SYSTEM_METRIC, "arch", sysInfo.getPropertyAsAString("arch"));
- this.trackGaEvent(CAT_SYSTEM_METRIC, "cpucount", cpucount, cpucount);
- }
-
- this.trackDmEvent("ko_memory", memSize);
- this.trackDmEvent("ko_arch", sysInfo.getPropertyAsAString("arch"));
- this.trackDmEvent("ko_cpucount", cpucount);
-
- var startupTime = Math.floor(Date.now() / 1000);
- var interval = 43200;
- var lastHeartBeat = prefs.getLong("analytics_last_heartbeat", 0);
-
- var heartBeat = () =>
- {
- var now = Math.floor(Date.now() / 1000);
- if (now - lastHeartBeat >= 43200)
- this.trackDmEvent("heart_beat", { run_time: startupTime - now });
- lastHeartBeat = now;
-
- setTimeout(heartBeat, interval+60); // offset by 60, just to be safe
- };
- heartBeat();
-
- ko.main.addWillCloseHandler(() =>
- {
- var now = Math.floor(Date.now() / 1000);
- this.trackDmEvent("exit", { state: "succeeded", run_time: startupTime - now });
- });
-
- this.bindListeners();
- };
-
- /**
- * Debug helper, when called this starts listening for debug messages from ganalytics
- * Helps tracking ganalytics debug info, but also allows users to track
- * what data is being send
- */
- this.debug = () =>
- {
- log.setLevel(10);
- var proxy = document.getElementById('analyticsProxy').contentWindow;
- var debug = proxy.document.getElementById('debug');
- if (debug.textContent.length) log.debug(debug.textContent);
- debug.textContent = '';
-
- setTimeout(this.debug, 500);
- };
-
- /**
- * Event listeners
- */
- this.bindListeners = () =>
- {
- window.addEventListener('editor_view_opened', this._eventProxy.bind(this, this.onViewOpened));
- window.addEventListener('focus', this._eventProxy.bind(this, this.onWindowFocus));
- document.getElementById('toolbox_side').addEventListener('click', this._eventProxy.bind(this, this.onSidetoolbarClick));
- window.addEventListener('current_widget_changed', this._eventProxy.bind(this, this.onWidgetChanged));
- //window.addEventListener('loadDialog', e => e.detail["dialog"]
- // .addEventListener('focus',_proxy.bind(this, this.onWindowFocus)) );
-
- var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].getService(Ci.nsIWindowWatcher);
- ww.registerNotification(this.onWindowOpened);
-
- prefs.prefObserverService.addObserver(this.onPrefChanged, "__all__", false);
- };
-
- ///**
- // * Listen to changes on deck elems for pageviews
- // *
- // * @param {Window} _window
- // */
- //this.bindDeckListeners = (_window) =>
- //{
- // if (_window._hasDeckListeners) return;
- // _window._hasDeckListeners = true;
- //
- // // Get deck id's that we want to track
- // if ( ! ("_trackDecks" in this))
- // {
- // this._trackDecks = [];
- // var _decks = prefs.getPref('analytics_track_decks');
- // for (let x=0;x<_decks.length;x++)
- // {
- // this._trackDecks.push(_prefs.getString(x));
- // }
- // }
- //
- // // Iterate over all decks in the window and track "select" event on those
- // // that we opted in to track
- // var elem = _window.document.getElementsByTagName("deck");
- // for (let [,elem] in Iterator(elems))
- // {
- // if (this._trackDecks.indexOf(elem.getAttribute("id")) == -1) continue;
- // ((_elem) => {
- // _elem.addEventListener("select", (e) => {
- // if (e.target!=e.originalTarget) return;
- // this.trackPageView(section + "#deck-" + _elem.getAttribute("id") + "-" + _elem.selectedIndex)
- // });
- // })(elem);
- // }
- //};
-
- /**
- * Triggered when a pref has been changed, holds the observe key used by
- * the prefobserver
- */
- this.onPrefChanged = { observe: (subject, topic, data) => {
- var val;
- switch (topic) {
- // Scheme prefs
- case 'keybinding-scheme':
- case 'editor-scheme':
- case 'interface-scheme':
- case 'widget-scheme':
- val = ko.prefs.getStringPref(topic);
- this.trackEvent(CAT_PREF_METRIC, "global_" + data, val);
- break;
-
- // Track the string value for these prefs
- case 'ui.tabs.sidepanes.left.layout':
- case 'ui.tabs.sidepanes.right.layout':
- case 'ui.tabs.sidepanes.bottom.layout':
- val = ko.prefs.getStringPref(data);
- this.trackEvent(CAT_PREF_METRIC, "global_" + data, val);
- break;
-
- // Track boolean state, int value or otherwise just track that the pref was set
- default:
- if (prefs.getPrefType(data) == 'boolean')
- {
- val = ko.prefs.getBooleanPref(data);
- this.trackEvent(CAT_PREF_METRIC, "global_" + data, val, val ? 1 : 0);
- }
- else if (prefs.getPrefType(data) == 'long')
- {
- val = ko.prefs.getLongPref(data);
- this.trackEvent(CAT_PREF_METRIC, "global_" + data, val, val);
- }
- else
- {
- this.trackEvent(CAT_PREF_METRIC, "global_" + data);
- }
- break;
- }
- }};
-
- /**
- * Triggered when a view (editor) has been opened
- */
- this.onViewOpened = (e) =>
- {
- var view = e.detail.view;
- this.trackPageView("/editor/" + view.koDoc.language);
- if ("koDoc" in view && "file" in view.koDoc && view.koDoc.file && "scimoz" in view)
- {
- this.trackEvent(CAT_FILE_METRIC, "Opened");
- this.trackEvent(CAT_FILE_METRIC, "Language", view.koDoc.language);
-
- // Track filesize, but standarize it a bit so we can group similar
- // filesizes together
- var size = DownloadUtils.convertByteUnits(view.scimoz.textLength);
- var bins = [10,50,100,200,300,400,500,600,700,800,900];
- var binIndex = this._getNumberBin(size[0], bins);
-
- this.trackEvent(CAT_FILE_METRIC, "Size",
- (binIndex > 0 ? bins[binIndex-1] : 0) + "-" + bins[binIndex] + " " + size[1]);
-
- if (view.koDoc.file.isLocal)
- {
- this.trackEvent(CAT_FILE_METRIC, "Location", "Local");
- }
- else
- {
- this.trackEvent(CAT_FILE_METRIC, "Location", "Remote");
- }
- }
- };
-
- this.onWindowOpened = { observe: (_window, topic) => //aSubject, aTopic, aData
- {
- var docElem = _window.document.documentElement;
- var windowId = docElem.getAttribute("id");
- var section = _window.location.href.replace(sectionRegex, '');
-
- if (windowId == "commonDialog")
- return;
-
- if (windowId == "prefWindow")
- {
- this.trackPageView(section);
- }
-
- if (docElem.nodeType == 'wizard')
- {
- var onWizardPageStep = () => this.trackPageView(section + "#wizard-step-" + docElem.pagestep);
- var onWizardFinish = () => this.trackPageView(section + "#wizard-finish");
- var onWizardCancel = () => this.trackPageView(section + "#wizard-cancel");
-
- docElem.addEventListener("wizardnext", onWizardPageStep);
- docElem.addEventListener("wizardback", onWizardPageStep)
- docElem.addEventListener("wizardfinish", onWizardPageStep)
- docElem.addEventListener("wizardcancel", onWizardPageStep)
- }
-
- _window.addEventListener('focus', this._eventProxy.bind(this, this.onWindowFocus));
- }};
-
- /**
- * Track "page" views on window focus
- */
- this.onWindowFocus = (e) =>
- {
- var _window = e.view;
- var windowId = _window.document.documentElement.getAttribute("id");
-
- // Don't track page views if the "page" didnt change (panels can cause repeat focus events)
- if (this.onWindowFocus._previous == windowId)
- return;
- this.onWindowFocus._previous = windowId;
-
- var section = _window.location.href.replace(sectionRegex, '');
- // Document title may disclose personal information (file / project name)
- // Disabled this entirely for now as the document title isn't that relevant
- //var title = ("document" in _window) ? window.document.title : null;
-
- if (_window.document.documentElement.nodeType == 'wizard')
- {
- section += "#wizard-step-" + _window.document.documentElement.pagestep;
- }
-
- if (windowId == "prefWindow")
- {
- var panelFrame = _window.document.getElementById('panelFrame');
- var frame = panelFrame.children[panelFrame.selectedIndex];
- var section = frame.getAttribute("src").replace(sectionRegex, '');
- }
-
- this.trackPageView(section);
- };
- this.onWindowFocus._previous = null;
-
- this.onSidetoolbarClick = (e) =>
- {
- if (e.target.nodeName != "toolbarbutton")
- return;
-
- if (e.target.classList.contains("dynamic-button"))
- {
- this.trackEvent(CAT_BUTTONS_METRIC, "dynamic-button", e.target.getAttribute("label") || e.target.getAttribute("id"));
- }
-
- if (e.target.parentNode.getAttribute("id") == "toolsToolbarGroup")
- {
- this.trackEvent(CAT_BUTTONS_METRIC, "static-tool-button", e.target.getAttribute("label") || e.target.getAttribute("id"));
- }
- };
-
- this.onWidgetChanged = (e) =>
- {
- var label = e.detail.getAttribute("label") || e.detail.getAttribute("id");
-
- // Debug widget labels include the filename, so force the label
- if (label.indexOf("Debug:") === 0)
- label = "Debugging";
-
- this.trackEvent(CAT_WIDGET_METRIC, "widget-accessed", label);
- };
-
- var _lastPageView = null;
- /**
- * Track page view by location and title
- *
- * @param {String} section
- * @param {String} title
- */
- this.trackPageView = (section, title) =>
- {
- if (_lastPageView == section) return;
- _lastPageView = section;
-
- log.debug("Tracking pageview. Section: " + section);
-
- var event = {
- hitType: 'pageview',
- page: section,
- location: section
- };
-
- if (title) event.title = title;
-
- this._proxyGa("send", event);
-
- var dmEvent = {
- page: event.page,
- location: event.location,
- title: event.title || undefined
- };
-
- this._proxyDm("send", "opened", dmEvent);
- };
-
- this.trackEvent = (category, action, label, value) =>
- {
- this.trackGaEvent(category, action, label, value);
- this.trackDmEvent([category, action, label].filter((v) => !! v).join("_"), value);
- };
-
- /**
- * Track a custom event
- *
- * @param {String} category Typically the object that was interacted with (e.g. file)
- * @param {String} action The type of interaction (e.g. opened)
- * @param {String} label Useful for categorizing events (e.g. python)
- * @param {Integer} value Values must be non-negative. Useful to pass counts (e.g. filename length)
- */
- this.trackGaEvent = (category, action, label, value) =>
- {
- log.debug("Tracking event.\n\nCategory: " + category +
- ",\nAction: " + action + "\nLabel: " + label +
- ",\nValue: " + value + "\n");
-
- var event = {
- hitType: 'event',
- eventCategory: category,
- eventAction: action
- };
-
- if (label) event.eventLabel = new String(label);
- if (value) event.eventValue = parseInt(value);
-
- this._proxyGa("send", event);
- };
-
- /**
- * Track a DM event
- */
- this.trackDmEvent = (event, value) =>
- {
- return; // disabled for the time being
- log.debug("Tracking DM event : " + event);
- this._proxyDm("send", event, value);
- };
-
- /**
- * Set a deskmetrics user/session property
- *
- * @param {String|Object} properties
- * @param {String} value
- */
- this.setDmProperty = (key, value) =>
- {
- return; // disabled for the time being
- this._proxyDm("setProperty", key, value);
- };
-
- /**
- * Set a google analytics user/session property
- *
- * @param {String|Object} properties
- * @param {String} value
- */
- this.setGaProperty = (properties, value) =>
- {
- if (value)
- {
- var _properties = {};
- _properties[properties] = new String(value);
- properties = _properties;
- }
-
- this._proxyGa("set", properties);
- };
-
- this._getProxy = () =>
- {
- if ( ! this._getProxy._window)
- {
- var elem = document.getElementById('analyticsProxy');
- if (elem)
- this._getProxy._window = elem.contentWindow;
- }
-
- return this._getProxy._window || null;
- };
-
- /**
- * Send data over the deskmetrics proxy
- */
- this._proxyDm = (...args) =>
- {
- return // disabled for the time being
- var method = args.shift()
- this._getProxy().$dm[method].apply(this._getProxy(), args);
- };
-
- /**
- * Send data over the GA proxy
- */
- this._proxyGa = (...args) =>
- {
- this._getProxy().ga.apply(this._getProxy(), args);
- };
-
- /**
- * Group "amount" under relevant "bin"
- *
- * @param {Integer} amount
- * @param {Array} bins Must be sorted ASC, eg. [1024, 10240, 102400]
- *
- * @returns index of matching bin
- */
- this._getNumberBin = (amount, bins) =>
- {
- for (let [x,bin] in Iterator(bins))
- {
- if (amount < bin) return x;
- }
- return bins.length-1;
- }
-
- this._eventProxy = (cb, ...args) =>
- {
- try {
- cb.apply(this, args);
- } catch (e) {
- log.exception(e);
- }
- };
-
-};
-
-// Start after the workspace_restored even is fired, as we don't want to track any
-// events triggered by the restore
-window.addEventListener("workspace_restored", ko.analytics.init.bind(ko.analytics));
diff --git a/src/modules/analytics/content/overlay.xul b/src/modules/analytics/content/overlay.xul
deleted file mode 100644
index f2786f5e0..000000000
--- a/src/modules/analytics/content/overlay.xul
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!-- Copyright (c) 2000-2012 ActiveState Software Inc. -->
-<!-- See the file LICENSE.txt for licensing information. -->
-<!DOCTYPE overlay PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<overlay id="analyticsOverlay"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script src="chrome://analytics/content/analytics.js"
- type="application/x-javascript;version=1.7"/>
-
-
- <deck id="komodo-box">
- <browser id="analyticsProxy"
- type="content"
- src="chrome://analytics/content/proxy.html"
- insertafter="printBrowser"/>
-
- </deck>
-
-</overlay>
diff --git a/src/modules/analytics/content/proxy.html b/src/modules/analytics/content/proxy.html
deleted file mode 100644
index 98826ea7f..000000000
--- a/src/modules/analytics/content/proxy.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-</head>
-<body>
-<div id="debug"></div>
-<script type="text/javascript">
- /**
- * Replace window.console with our debugging version.
- *
- * Note: This must be done before window.onload, otherwise it will throw an
- * exception.
- */
- var elem = document.getElementById("debug");
- var debug = function(text) {
- elem.textContent = elem.textContent + "\n" + text;
- }
- window.console = {
- log: (msg) => debug("proxy log: " + msg),
- debug: (msg) => debug("proxy debug: " + msg),
- error: (msg) => debug("proxy error: " + msg),
- info: (msg) => debug("proxy info: " + msg)
- }
-
- /**
- * Load the google analytics script.
- */
- function ga_initialize() {
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','https://www.google-analytics.com/analytics_debug.js','ga');
- }
-</script>
-<!--
-disabled for the time being
-<script src="http://cdn.pingstatsnet.com/sdk/deskmetrics-2.1.0-min.js"></script>
--->
-</body>
-</html>
diff --git a/src/modules/analytics/install.rdf b/src/modules/analytics/install.rdf
deleted file mode 100644
index f2952662c..000000000
--- a/src/modules/analytics/install.rdf
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:id>[email protected]</em:id>
- <em:name>Analytics</em:name>
- <em:version>1.0.0</em:version>
- <em:description>Provide anonymous analytics to the Komodo devs to improve Komodo</em:description>
- <em:creator>Nathan Rijksen</em:creator>
- <em:homepageURL></em:homepageURL>
- <em:type>2</em:type> <!-- type=extension -->
- <em:unpack>false</em:unpack>
-
- <em:targetApplication> <!-- Komodo IDE -->
- <Description>
- <em:id>{36E66FA0-F259-11D9-850E-000D935D3368}</em:id>
- <em:minVersion>7.0</em:minVersion>
- <em:maxVersion>12.*</em:maxVersion>
- </Description>
- </em:targetApplication>
- <em:targetApplication> <!-- Komodo Edit -->
- <Description>
- <em:id>{b1042fb5-9e9c-11db-b107-000d935d3368}</em:id>
- <em:minVersion>7.0</em:minVersion>
- <em:maxVersion>12.*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>
diff --git a/src/modules/analytics/locale/en-US/analytics.properties b/src/modules/analytics/locale/en-US/analytics.properties
deleted file mode 100644
index c7629485a..000000000
--- a/src/modules/analytics/locale/en-US/analytics.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-analytics.optin.ask.message=Please help us make Komodo even better by providing anonymous statistics about your usage
-analytics.optin.confirm.label=Sure thing!
-analytics.optin.confirm.accessKey=s
-analytics.optin.deny.label=I'd rather not
-analytics.optin.deny.accessKey=n
-analytics.optin.thanks.message=Thanks for helping us make Komodo better! You rock!
diff --git a/src/prefs/prefs.p.xml b/src/prefs/prefs.p.xml
index be3c86dcc..a857cd3b4 100644
--- a/src/prefs/prefs.p.xml
+++ b/src/prefs/prefs.p.xml
@@ -1601,7 +1601,7 @@ SSL_CLIENT_I_C=
<boolean id="places.multiple_project_view">0</boolean>
<!-- Analytics -->
- <string id="analytics_ga_id">UA-47685083-3</string>
+ <string id="analytics_ga_id">3d09d7e1-ec13-40a6-8307-f22a41c15bcf</string>
<string id="analytics_deskmetrics_id">6r25977273</string>
<boolean id="analytics_enabled">1</boolean> <!-- Analytics is opt-out, not opt-in -->
commit 265f7509154efd80d3463144987ad8e915c82f81
Author: Carey Hoffman <[email protected]>
Date: Tue Mar 3 16:12:12 2020 -0800
Delete pad files
diff --git a/Blackfile.py b/Blackfile.py
index bc4781a0d..544d4f123 100644
--- a/Blackfile.py
+++ b/Blackfile.py
@@ -2096,9 +2096,7 @@ def UploadKomodoPackages(cfg, argv):
for dirpath, dirnames, filenames in os.walk(cfg.packagesRelDir):
reldir = _relpath(dirpath, cfg.packagesRelDir).replace('\\', '/')
for filename in filenames:
- if "pad" in reldir.split('/'):
- pass
- elif fnmatch(filename, "dbgp-*.tar.gz"):
+ if fnmatch(filename, "dbgp-*.tar.gz"):
pass
elif filename in [
"komodo_javascript_debugger.xpi",
@@ -2131,7 +2129,6 @@ def PackageKomodo(cfg, argv):
remotedebugging the remote debugging packages for this plat
mozpatches a zip of the Mozilla patches for the used moz build
updates update package(s) for the autoupdate system
- pad PAD file
symbols breakpad crash report symbol files
Sets of packages:
@@ -2146,10 +2143,10 @@ def PackageKomodo(cfg, argv):
"""
args = argv[1:] or ["std"]
if "all" in args:
- packages = ["installer", "pad", "remotedebugging",
+ packages = ["installer", "remotedebugging",
"mozpatches", "updates", "crashreportsymbols"]
elif "std" in args:
- packages = ["installer", "pad", "crashreportsymbols"]
+ packages = ["installer", "crashreportsymbols"]
if cfg.productType == "ide":
if cfg.buildPlatform.startswith("linux") \
and cfg.buildPlatform.endswith("x86"):
@@ -2183,8 +2180,6 @@ def PackageKomodo(cfg, argv):
retval = _PackageKomodoDMG(cfg)
else:
retval = _PackageKomodoASPackage(cfg)
- elif package == "pad":
- retval = _PackageKomodoPAD(cfg)
elif package == "updates":
retval = _PackageKomodoUpdates(cfg)
elif package == "crashreportsymbols":
@@ -2194,30 +2189,6 @@ def PackageKomodo(cfg, argv):
if retval:
raise Error("error packaging '%s': retval=%r" % (package, retval))
-
-def _PackageKomodoPAD(cfg):
- genpad_path = join("src", "pad", "genpad.py")
- output_dir = join(cfg.packagesAbsDir, "internal", "pad",
- "komodo_%s" % cfg.productType)
- license_text_path = join("src", "license_text",
- "LICENSE.%s.txt" % cfg.licenseTextType)
- if not exists(output_dir):
- os.makedirs(output_dir)
-
- # The PAD file.
- cmd = 'python %s -d "%s" -L "%s"' % (
- genpad_path, output_dir, license_text_path)
- _run(cmd)
-
- # The screenshot file.
- plat_os = cfg.buildPlatform.split('-', 1)[0]
- _cp(join("src", "pad", "komodo_%s_%s.png" % (cfg.productType, plat_os)),
- output_dir)
-
- # The icon file.
- _cp(join("src", "main", "komodo32.%s.png" % cfg.productType),
- join(output_dir, "komodo_orb_32.png"))
-
def _PackageKomodoMozillaPatches(cfg):
"""The Komodo "mozpatches" package is just a simple packaging up of the
mozilla patches applied to the moz build for the used moz build.
diff --git a/bin/mkrc.py b/bin/mkrc.py
index f679c18e1..f3b5c6e7e 100755
--- a/bin/mkrc.py
+++ b/bin/mkrc.py
@@ -101,11 +101,10 @@ Build Master: %(builder)s
class _BuildInfo(object):
"""Info on a particular Komodo build."""
- def __init__(self, proj, pkg_prefix, pad_name, log_prefix, short_ver, rev,
+ def __init__(self, proj, pkg_prefix, log_prefix, short_ver, rev,
devbuild_dir, platnames=None, exclude_auto_update=False):
self.proj = proj
self.pkg_prefix = pkg_prefix
- self.pad_name = pad_name
self.log_prefix = log_prefix
self.short_ver = short_ver
self.major_ver = int(short_ver.split('.', 1)[0])
@@ -238,9 +237,6 @@ def mkrc(branch="rel", ide_revision=None, edit_revision=None, dry_run=False,
t = Tree()
t.add("internal")
t.add("internal/log")
- t.add("internal/pad")
- t.add("internal/pad/komodo_ide")
- t.add("internal/pad/komodo_edit")
t.add("internal/crashreportsymbols")
t.add("remotedebugging")
if not exclude_auto_update:
@@ -435,26 +431,6 @@ def get_rc_manifest(builds):
# are named 'macosx'.
platname = "macosx"
- # PAD files
- pad_name = build.pad_name
- pad_plat = platname.replace('-', '_')
- pad_os = platname.split('-', 1)[0]
- rc_manifest.add( # PAD file
- ("internal/pad/%s/%s_%s.xml" % (pad_name, pad_name, pad_plat),
- ujoin(devbuild_dir, "internal", "pad", pad_name)))
- rc_manifest.add( # PAD screenshot
- ("internal/pad/%s/%s_%s.png" % (pad_name, pad_name, pad_os),
- ujoin(devbuild_dir, "internal", "pad", pad_name)))
-
- if pad_name == "komodo_ide":
- rc_manifest.add( # PAD icon
- ("internal/pad/%s/komodo_orb_32.png" % (pad_name),
- ujoin(devbuild_dir, "internal", "pad", pad_name)))
- elif pad_name == "komodo_edit":
- rc_manifest.add( # PAD icon
- ("internal/pad/%s/komodoedit_orb_32.png" % (pad_name),
- ujoin(devbuild_dir, "internal", "pad", pad_name)))
-
# Crash report symbols zip file.
symbols_filename = crashreportsymbols_zip_name(pkg_prefix, pkg_ver, platname)
rc_manifest.add(
diff --git a/src/pad/README.txt b/src/pad/README.txt
deleted file mode 100644
index 6e9df43a7..000000000