Skip to content

Commit

Permalink
console logs for ez debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Blainegunn committed Sep 19, 2024
1 parent aa541dd commit 86776f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions acrobat/blocks/verb-widget/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const handleError = (err, errTxt, str, strTwo) => {
};

const setDraggingClass = (widget, shouldToggle) => {
// eslint-disable-next-line chai-friendly/no-unused-expressions
shouldToggle ? widget.classList.add('dragging') : widget.classList.remove('dragging');
};

Expand Down Expand Up @@ -141,6 +142,8 @@ export default async function init(element) {

// Errors, Analytics & Logging
window.addEventListener('unity:show-error-toast', (e) => {
console.log(`⛔️ Error Code - ${e.detail?.code}`);

if (e.detail?.code === 'only_accept_one_file') {
handleError(errorState, errorStateText, 'verb-widget-error-multi');
verbAnalytics('error', VERB);
Expand Down
13 changes: 13 additions & 0 deletions acrobat/scripts/alloy/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (params.dropzone2) {
}

export default function init(eventName, verb) {
console.log(`📡 Event Name - acrobat:verb-${verb}:${eventName}`);
const event = {
documentUnloading: true,
data: {
Expand All @@ -39,6 +40,12 @@ export default function init(eventName, verb) {
digitalData: {
dcweb: {
event: { pagename: `acrobat:verb-${verb}:${eventName}` },
content: {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
size: '2-5MB',
count: 1,
extension: 'docx',
},
source: {
user_agent: navigator.userAgent,
lang: document.documentElement.lang,
Expand All @@ -58,6 +65,12 @@ export default function init(eventName, verb) {
},
dcweb2: {
event: { pagename: `acrobat:verb-${verb}:${eventName}` },
content: {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
size: '2-5MB',
count: 1,
extension: 'docx',
},
source: {
user_agent: navigator.userAgent,
lang: document.documentElement.lang,
Expand Down

0 comments on commit 86776f3

Please sign in to comment.