Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dixa): Implement Dixa integration #2029

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/content/dixa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict';

togglbutton.render(
// Specify selector for element button needs to hook into
// Make sure to include :not(.toggl) to avoid duplicates
'.conversation-view__main [class^=conversationHeader__]:not(.toggl)',
{ observe: true },
function (elem) {

const getConversationId = () => {
const csid = document.querySelector('.conversation-view__main button span').textContent;
const title = document.querySelector('.conversation-view__main [class^=conversationHeader__] [class^=headline__] p').textContent;
return `${csid} ${title}`;
};

const getProject = () => {
const subdomain = window.location.host.replace(".dixa.com", "");
return subdomain;
}

// Create timer link element
const link = togglbutton.createTimerLink({
description: getConversationId,
buttonType: 'minimal',
projectName: getProject,
className: 'dixa'
});

// Add link to element
const host = elem.querySelector('[class^=topActions__] [class^=root__]')
host.insertBefore(link, null);
}
);
4 changes: 4 additions & 0 deletions src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export default {
url: '*://devdocs.io/*',
name: 'Devdocs.io'
},
'dixa.com': {
url: '*://*.dixa.com/*',
name: 'Dixa'
},
'dobambam.com': {
url: '*://*.dobambam.com/*',
name: 'Dobambam'
Expand Down