Skip to content

Commit

Permalink
Add new integration for next generation of LiquidPlanner for #2205
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenw-npi authored and nunofmn committed Jun 2, 2023
1 parent f5d858b commit b3406f7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/content/liquidplanner-next.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

// Main function
togglbutton.render(
// Specify selector for element button needs to hook into
// Make sure to include :not(.toggl) to avoid duplicates
'.lp-item-panel__header-actions:not(.toggl)',
{ observe: true },
function (elem) {
const taskDescription = document.querySelector(".breadcrumb > a").textContent;
const projectName = document.querySelector(".breadcrumb :nth-child(3)").textContent.slice(0, -1); // slice to remove trailing forward slash

// Create timer link element
const link = togglbutton.createTimerLink({
description: taskDescription,
buttonType: 'minimal', // button type, if skipped will render full size
projectName: projectName,
});

// Add link to element
elem.append(link);
}
);
4 changes: 4 additions & 0 deletions src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ export default {
url: '*://app.liquidplanner.com/*',
name: 'Liquidplanner'
},
'next.liquidplanner.com': {
url: '*://next.liquidplanner.com/*',
name: 'Liquidplanner Next'
},
'ladesk.com': {
url: '*://*.ladesk.com/*',
name: 'LiveAgent',
Expand Down

0 comments on commit b3406f7

Please sign in to comment.