Merge pull request #313 from adam3smith/adduris
add more item handler protocols to add by URI
This commit is contained in:
commit
bbf066f55a
1 changed files with 15 additions and 4 deletions
|
@ -410,8 +410,19 @@ Zotero.Attachments = new function(){
|
|||
function linkFromURL(url, sourceItemID, mimeType, title){
|
||||
Zotero.debug('Linking attachment from URL');
|
||||
|
||||
// Throw error on invalid URLs
|
||||
var urlRe = /^https?:\/\/[^\s]*$/;
|
||||
/* Throw error on invalid URLs
|
||||
We currently accept the following protocols:
|
||||
PersonalBrain (brain://)
|
||||
DevonThink (x-devonthink-item://)
|
||||
Notational Velocity (nv://)
|
||||
MyLife Organized (mlo://)
|
||||
Evernote (evernote://)
|
||||
OneNote (onenote://)
|
||||
Kindle (kindle://)
|
||||
Logos (logosres:)
|
||||
Zotero (zotero://) */
|
||||
|
||||
var urlRe = /^((https?|zotero|evernote|onenote|brain|nv|mlo|kindle|x-devonthink-item|ftp):\/\/|logosres:)[^\s]*$/;
|
||||
var matches = urlRe.exec(url);
|
||||
if (!matches) {
|
||||
throw ("Invalid URL '" + url + "' in Zotero.Attachments.linkFromURL()");
|
||||
|
|
Loading…
Add table
Reference in a new issue