improved on task id detection
This commit is contained in:
parent
c212b89eb7
commit
8796d9b2f6
|
@ -3,7 +3,7 @@
|
||||||
"identifier": "note-from-bitrix-task",
|
"identifier": "note-from-bitrix-task",
|
||||||
"script": "note-from-bitrix-task.qml",
|
"script": "note-from-bitrix-task.qml",
|
||||||
"authors": ["@pbek"],
|
"authors": ["@pbek"],
|
||||||
"version": "0.0.2",
|
"version": "1.0.3",
|
||||||
"minAppVersion": "17.05.6",
|
"minAppVersion": "17.05.6",
|
||||||
"description" : "This script creates a menu item and a button that parses the text that was copied from a task webpage of the webservice <a href='https://www.bitrix24.com/'>Bitrix24</a> and creates a new note with a headline, the link to the task and the description."
|
"description" : "This script creates a menu item and a button that parses the text that was copied from a task webpage of the webservice <a href='https://www.bitrix24.com/'>Bitrix24</a> and creates a new note with a headline, the link to the task and the description."
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,13 @@ QtObject {
|
||||||
var taskIdMatch = taskIdRegExp.exec(html);
|
var taskIdMatch = taskIdRegExp.exec(html);
|
||||||
if (taskIdMatch !== null) {
|
if (taskIdMatch !== null) {
|
||||||
headline += " (#" + taskIdMatch[1] + ")";
|
headline += " (#" + taskIdMatch[1] + ")";
|
||||||
|
} else {
|
||||||
|
// do an other attempt to add the task id to the headline
|
||||||
|
taskIdRegExp = />(Task|Aufgabe) #(\d+) -</im;
|
||||||
|
taskIdMatch = taskIdRegExp.exec(html);
|
||||||
|
if (taskIdMatch !== null) {
|
||||||
|
headline += " (#" + taskIdMatch[2] + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var descriptionRegExp = /<div.*? id="task-detail-description".*?>(.+?)<\/div>/im;
|
var descriptionRegExp = /<div.*? id="task-detail-description".*?>(.+?)<\/div>/im;
|
||||||
|
|
Loading…
Reference in New Issue