mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-22 16:08:09 +00:00
fixed task url detection
This commit is contained in:
parent
cb0da43ff5
commit
f83dc7d00e
2 changed files with 3 additions and 3 deletions
|
@ -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.1",
|
"version": "0.0.2",
|
||||||
"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."
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import QtQml 2.0
|
import QtQml 2.0
|
||||||
import com.qownnotes.noteapi 1.0
|
import QOwnNotesTypes 1.0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This script creates a menu item and a button that parses the text that was copied
|
* This script creates a menu item and a button that parses the text that was copied
|
||||||
|
@ -63,7 +63,7 @@ QtObject {
|
||||||
description = description.replace(/<br.*?>/gim, "\n").replace(/<.+?>/gim, "");
|
description = description.replace(/<br.*?>/gim, "\n").replace(/<.+?>/gim, "");
|
||||||
|
|
||||||
// var urlRegExp = /<form name="COMMENTS_.+?".*? action="(.+?)" method/im;
|
// var urlRegExp = /<form name="COMMENTS_.+?".*? action="(.+?)" method/im;
|
||||||
var urlRegExp = /<a href="(.+?)[\?#].*?" class="main-buttons-item-link"/im;
|
var urlRegExp = /<a href="(.+?\d+\/tasks\/task\/view\/d+\/)[\?#].*?" class="main-buttons-item-link"/im;
|
||||||
var urlMatch = urlRegExp.exec(html);
|
var urlMatch = urlRegExp.exec(html);
|
||||||
var url = urlMatch !== null ? urlMatch[1] : "";
|
var url = urlMatch !== null ? urlMatch[1] : "";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue