|
@@ -2136,7 +2136,8 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
|
}
|
|
|
|
|
|
func showPDFViewPrintViewController() {
|
|
|
-// self.menuItemAnnotationClick_Print(sender: NSMenuItem())
|
|
|
+ self.trackEvent_print()
|
|
|
+
|
|
|
self.showPrintWindow()
|
|
|
}
|
|
|
|
|
@@ -2146,6 +2147,7 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
|
//
|
|
|
// return
|
|
|
// }
|
|
|
+ self.trackEvent_aiTranslate()
|
|
|
Task { @MainActor in
|
|
|
if await (KMLightMemberManager.manager.canPayFunction() == false) {
|
|
|
let _ = KMSubscribeWaterMarkWindowController.show(window: self.view.window!, isAI: true) { isSub, _, isClose in
|
|
@@ -2187,6 +2189,10 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
|
self.view.window?.beginSheet(self.aiTranslationConfirWC!.window!)
|
|
|
}
|
|
|
|
|
|
+ func toolbarViewController(_ viewController: KMToolbarViewController, shareAction toolbarItem: KMToolBoxItem) {
|
|
|
+ self.trackEvent_share()
|
|
|
+ }
|
|
|
+
|
|
|
func toolbarViewController(_ viewController: KMToolbarViewController, shareDocument item: NSMenuItem) {
|
|
|
if (!self.saveWatermarkFlag) {
|
|
|
self.shareDocument(sender: viewController)
|
|
@@ -2283,11 +2289,9 @@ extension KMMainViewController : KMMainToolbarControllerDelegate {
|
|
|
//
|
|
|
// }
|
|
|
}
|
|
|
- if (type == .Annatiton) {
|
|
|
- KMAnalytics.trackEvent(eventName: "Btn_Tbr_Annotation", parameters: [
|
|
|
- KMAnalytics.Parameter.categoryKey : KMAnalytics.Parameter.Category.tbr,
|
|
|
- KMAnalytics.Parameter.labelKey : KMAnalytics.Parameter.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
- }
|
|
|
+
|
|
|
+ // 埋点
|
|
|
+ self.trackEvent(toolType: type)
|
|
|
|
|
|
if(type != .Page) {
|
|
|
if (hasEnterPageEdit()) {
|
|
@@ -3032,3 +3036,105 @@ extension KMMainViewController: KMPageNumberDisplayViewDelegate {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// MARK: - Analytics (埋点)
|
|
|
+
|
|
|
+extension KMMainViewController {
|
|
|
+ func trackEvent(toolType type: KMToolbarViewType) -> Void {
|
|
|
+ if (type == .Annatiton) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_Annotation", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .editPDF) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_EditPDF", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .Page) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_PageEdit", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .Conversion) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_Converter", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .Tool) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_Tools", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ func trackEvent_aiTranslate() -> Void {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_AITranslate", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ }
|
|
|
+
|
|
|
+ func trackEvent_print() -> Void {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_Print", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ }
|
|
|
+
|
|
|
+ func trackEvent_share() -> Void {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_Share", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ }
|
|
|
+
|
|
|
+ func trackEvent_upgrade() -> Void {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_Tbr_Upgrade", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.tbr,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.tbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ }
|
|
|
+
|
|
|
+ // CAnnotationType
|
|
|
+ func trackEvent(annotationType type: CAnnotationType) -> Void {
|
|
|
+ if (type == .highlight) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Highlight", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .underline) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Underline", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .strikeOut) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Strikethrough", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .ink) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Draw", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .freeText) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Text", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .anchored) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Note", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .square) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Shape", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .link) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Link", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .stamp) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Stamp", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ } else if (type == .signSignature) {
|
|
|
+ KMAnalytics.trackEvent(eventName: "Btn_SubTbr_Sign", parameters: [
|
|
|
+ KMAnalytics.Parameter.categoryKey : KMAnalytics.Category.subTbr_annotation,
|
|
|
+ KMAnalytics.Parameter.labelKey : KMAnalytics.Label.subTbr_Btn], platform: .AppCenter, appTarget: .dmg)
|
|
|
+ }
|
|
|
+// else if (type == .addText) {
|
|
|
+
|
|
|
+// } else if (type == .addImage) {
|
|
|
+
|
|
|
+// } else if (type == .)
|
|
|
+ }
|
|
|
+}
|