6 Commits

6 changed files with 8586 additions and 4694 deletions

File diff suppressed because it is too large Load Diff

7977
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "3cx-tapi",
"description": "3CX CP Tapi and Projectmanager integration",
"version": "9.0.0",
"version": "9.0.3",
"author": {
"name": "Daniel Triendl",
"email": "d.triendl@cp-solutions.at"
@ -24,34 +24,33 @@
},
"private": true,
"dependencies": {
"axios": "0.21.1",
"axios-userscript-adapter": "0.1.4",
"chrono-node": "^2.3.0"
"axios": "0.27.2",
"axios-userscript-adapter": "0.1.12",
"chrono-node": "^2.4.1"
},
"devDependencies": {
"@babel/core": "7.14.6",
"@babel/preset-env": "7.14.5",
"@typescript-eslint/eslint-plugin": "4.27.0",
"@typescript-eslint/parser": "4.27.0",
"babel-loader": "8.2.2",
"browserslist": "4.16.6",
"css-loader": "5.2.6",
"eslint": "7.29.0",
"eslint-config-standard": "16.0.3",
"eslint-plugin-import": "2.23.4",
"@babel/core": "7.19.3",
"@babel/preset-env": "7.19.3",
"@typescript-eslint/eslint-plugin": "5.38.1",
"@typescript-eslint/parser": "5.38.1",
"babel-loader": "8.2.5",
"browserslist": "4.21.4",
"css-loader": "6.7.1",
"eslint": "8.24.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.0",
"eslint-plugin-standard": "4.1.0",
"less": "4.1.1",
"less-loader": "10.0.0",
"style-loader": "2.0.0",
"ts-loader": "9.2.3",
"typescript": "4.3.4",
"userscript-metadata-webpack-plugin": "0.1.0",
"webpack": "5.39.1",
"webpack-bundle-analyzer": "4.4.2",
"webpack-cli": "4.7.2",
"webpack-livereload-plugin": "3.0.1",
"eslint-plugin-promise": "6.0.1",
"less": "4.1.3",
"less-loader": "11.0.0",
"style-loader": "3.3.1",
"ts-loader": "9.4.1",
"typescript": "4.8.4",
"userscript-metadata-webpack-plugin": "0.1.5",
"webpack": "5.74.0",
"webpack-bundle-analyzer": "4.6.1",
"webpack-cli": "4.10.0",
"webpack-livereload-plugin": "3.0.2",
"webpack-merge": "5.8.0"
}
}

View File

@ -9,7 +9,7 @@ console.log('script start')
const search = new Search()
// eslint-disable-next-line no-undef
waitForKeyElements('ongoing-call-button', (element) => { search.createSearchWindow(element) }, true)
waitForKeyElements('ongoing-call-button', (element) => { search.createSearchWindow(element) }, false)
const callNotification = new CallNotification()
// eslint-disable-next-line no-undef

9
src/search.css Normal file
View File

@ -0,0 +1,9 @@
.tapi-search-result {
color: #000;
padding: 5px;
}
.tapi-search-result:hover, .tapi-search-result-selected {
background-color: #E7E6E6;
}

View File

@ -1,3 +1,4 @@
import './search.css'
import { TapiContact } from './tapi-contact'
import { debounce } from './debounce'
import { axios, fireChangeEvents } from './utils'
@ -19,6 +20,8 @@ export class Search {
}
if (items.length > 0) {
this.dial((<HTMLElement>items[0]).dataset.tapiNumber)
} else {
this.dial((<HTMLInputElement>document.getElementById('tapiSearchInput')).value)
}
return false
@ -135,7 +138,6 @@ export class Search {
contacts.forEach(contact => {
var li = document.createElement('li')
li.classList.add('tapi-search-result')
li.classList.add('search-result')
li.classList.add('pointer')
li.onmouseover = () => { this.selectResult(li) }
li.dataset.tapiNumber = contact.tD_NUMBER_TAPI
@ -161,11 +163,9 @@ export class Search {
private selectResult (resultLi: Element) {
var items = document.getElementsByClassName('tapi-search-result')
for (var item of items) {
item.classList.remove('bg-light')
item.classList.remove('tapi-search-result-selected')
}
resultLi.classList.add('bg-light')
resultLi.classList.add('tapi-search-result-selected')
}