{"action":"created","comment":{"url":"https://api.github.com/repos/zotero/translators/pulls/comments/26529717","id":26529717,"diff_hunk":"@@ -0,0 +1,99 @@\n+{\n+\t\"translatorID\": \"7bbef39f-8bb9-44d7-826f-47ce75eb15ae\",\n+\t\"label\": \"FreeCite\",\n+\t\"creator\": \"Philipp Zumstein\",\n+\t\"target\": \"^https?://freecite\\\\.library\\\\.brown\\\\.edu/citations/create\",\n+\t\"minVersion\": \"3.0\",\n+\t\"maxVersion\": \"\",\n+\t\"priority\": 100,\n+\t\"inRepository\": true,\n+\t\"translatorType\": 4,\n+\t\"browserSupport\": \"gcsibv\",\n+\t\"lastUpdated\": \"2015-03-16 21:10:44\"\n+}\n+\n+/*\n+\t***** BEGIN LICENSE BLOCK *****\n+\n+\tCopyright © 2015 Philipp Zumstein\n+\n+\tThis file is part of Zotero.\n+\n+\tZotero is free software: you can redistribute it and/or modify\n+\tit under the terms of the GNU Affero General Public License as published by\n+\tthe Free Software Foundation, either version 3 of the License, or\n+\t(at your option) any later version.\n+\n+\tZotero is distributed in the hope that it will be useful,\n+\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n+\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+\tGNU Affero General Public License for more details.\n+\n+\tYou should have received a copy of the GNU Affero General Public License\n+\talong with Zotero. If not, see <http://www.gnu.org/licenses/>.\n+\n+\t***** END LICENSE BLOCK *****\n+*/\n+\n+var index = 0;\n+var itemList = [];\n+var titleList = {};\n+\n+function detectWeb(doc, url) {\n+\tif (doc.getElementsByTagName(\"code\").length &&\n+\t\tdoc.getElementsByTagName(\"code\")[0].textContent.indexOf(\"<\")>-1) {\n+\t\treturn \"multiple\";\n+\t}\n+}\n+\n+function doWeb(doc, url) {\n+\t\n+\tvar text = \"\";\n+\n+\tvar codes = doc.getElementsByTagName(\"code\");\n+\tfor (var i = 0; i < codes.length; i++) {\n+\t\ttextContent = codes[i].textContent;\n+\t\t// there is always a dummy object <code>ContextObject</code> which we want to exclude here\n+\t\tif (textContent.indexOf(\"<\")>-1) { \n+\t\t\ttext += textContent;\n+\t\t}\n+\t}\n+\ttext = text.replace(/<ctx:context-objects [^>]*>/g, '').replace(/<\\/ctx:context-objects>/g, '');\n+\ttext = \"<ctx:context-objects xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='info:ofi/fmt:xml:xsd:ctx http://www.openurl.info/registry/docs/info:ofi/fmt:xml:xsd:ctx' xmlns:ctx='info:ofi/fmt:xml:xsd:ctx'>\"\n+\t\t+ text\n+\t\t+ \"</ctx:context-objects>\";","path":"FreeCite.js","position":64,"original_position":64,"commit_id":"04d713876383841193c37eb313e27625dc2837c5","original_commit_id":"04d713876383841193c37eb313e27625dc2837c5","user":{"login":"aurimasv","id":1381759,"avatar_url":"https://avatars.githubusercontent.com/u/1381759?v=3","gravatar_id":"","url":"https://api.github.com/users/aurimasv","html_url":"https://github.com/aurimasv","followers_url":"https://api.github.com/users/aurimasv/followers","following_url":"https://api.github.com/users/aurimasv/following{/other_user}","gists_url":"https://api.github.com/users/aurimasv/gists{/gist_id}","starred_url":"https://api.github.com/users/aurimasv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aurimasv/subscriptions","organizations_url":"https://api.github.com/users/aurimasv/orgs","repos_url":"https://api.github.com/users/aurimasv/repos","events_url":"https://api.github.com/users/aurimasv/events{/privacy}","received_events_url":"https://api.github.com/users/aurimasv/received_events","type":"User","site_admin":false},"body":"you can simplify this by replacing only the internal `<ctx:context-objects...>` tags. i.e. `text.replace(/<ctx:context-objects(?: [^>]*)?>\\s*<\\/ctx:context-objects>/g, '')`","created_at":"2015-03-16T21:31:51Z","updated_at":"2015-03-16T21:31:51Z","html_url":"https://github.com/zotero/translators/pull/865#discussion_r26529717","pull_request_url":"https://api.github.com/repos/zotero/translators/pulls/865","_links":{"self":{"href":"https://api.github.com/repos/zotero/translators/pulls/comments/26529717"},"html":{"href":"https://github.com/zotero/translators/pull/865#discussion_r26529717"},"pull_request":{"href":"https://api.github.com/repos/zotero/translators/pulls/865"}}},"pull_request":{"url":"https://api.github.com/repos/zotero/translators/pulls/865","id":31201648,"html_url":"https://github.com/zotero/translators/pull/865","diff_url":"https://github.com/zotero/translators/pull/865.diff","patch_url":"https://github.com/zotero/translators/pull/865.patch","issue_url":"https://api.github.com/repos/zotero/translators/issues/865","number":865,"state":"open","locked":false,"title":"Split CTX translator into seperate web and import translator","user":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"body":"I would like to ask for an opinion, whether this direction would be okay to go. Splitting web and import translator is an issue I have read about here.\r\n\r\nFor CTX it seems the easiest that the import translator is calling the web translator. I tried first the other way around, but became some problems with `selectItems` function call in the called translator.\r\n\r\nThe approach here (import translator calls web translator) solves the naming problem on import and looks easy to complete. However, I feel that ideally we would have it the other way (web translator calls import translator). Is it worth to spend (much) more time into CTX?","created_at":"2015-03-15T15:14:34Z","updated_at":"2015-03-16T21:31:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4b998dddcb71734f21e55ae2ba63a22aa366978","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zotero/translators/pulls/865/commits","review_comments_url":"https://api.github.com/repos/zotero/translators/pulls/865/comments","review_comment_url":"https://api.github.com/repos/zotero/translators/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zotero/translators/issues/865/comments","statuses_url":"https://api.github.com/repos/zotero/translators/statuses/04d713876383841193c37eb313e27625dc2837c5","head":{"label":"zuphilip:ctx-split","ref":"ctx-split","sha":"04d713876383841193c37eb313e27625dc2837c5","user":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"repo":{"id":23522231,"name":"translators","full_name":"zuphilip/translators","owner":{"login":"zuphilip","id":5199995,"avatar_url":"https://avatars.githubusercontent.com/u/5199995?v=3","gravatar_id":"","url":"https://api.github.com/users/zuphilip","html_url":"https://github.com/zuphilip","followers_url":"https://api.github.com/users/zuphilip/followers","following_url":"https://api.github.com/users/zuphilip/following{/other_user}","gists_url":"https://api.github.com/users/zuphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/zuphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuphilip/subscriptions","organizations_url":"https://api.github.com/users/zuphilip/orgs","repos_url":"https://api.github.com/users/zuphilip/repos","events_url":"https://api.github.com/users/zuphilip/events{/privacy}","received_events_url":"https://api.github.com/users/zuphilip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zuphilip/translators","description":"Zotero Translators","fork":true,"url":"https://api.github.com/repos/zuphilip/translators","forks_url":"https://api.github.com/repos/zuphilip/translators/forks","keys_url":"https://api.github.com/repos/zuphilip/translators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zuphilip/translators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zuphilip/translators/teams","hooks_url":"https://api.github.com/repos/zuphilip/translators/hooks","issue_events_url":"https://api.github.com/repos/zuphilip/translators/issues/events{/number}","events_url":"https://api.github.com/repos/zuphilip/translators/events","assignees_url":"https://api.github.com/repos/zuphilip/translators/assignees{/user}","branches_url":"https://api.github.com/repos/zuphilip/translators/branches{/branch}","tags_url":"https://api.github.com/repos/zuphilip/translators/tags","blobs_url":"https://api.github.com/repos/zuphilip/translators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zuphilip/translators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zuphilip/translators/git/refs{/sha}","trees_url":"https://api.github.com/repos/zuphilip/translators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zuphilip/translators/statuses/{sha}","languages_url":"https://api.github.com/repos/zuphilip/translators/languages","stargazers_url":"https://api.github.com/repos/zuphilip/translators/stargazers","contributors_url":"https://api.github.com/repos/zuphilip/translators/contributors","subscribers_url":"https://api.github.com/repos/zuphilip/translators/subscribers","subscription_url":"https://api.github.com/repos/zuphilip/translators/subscription","commits_url":"https://api.github.com/repos/zuphilip/translators/commits{/sha}","git_commits_url":"https://api.github.com/repos/zuphilip/translators/git/commits{/sha}","comments_url":"https://api.github.com/repos/zuphilip/translators/comments{/number}","issue_comment_url":"https://api.github.com/repos/zuphilip/translators/issues/comments{/number}","contents_url":"https://api.github.com/repos/zuphilip/translators/contents/{+path}","compare_url":"https://api.github.com/repos/zuphilip/translators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zuphilip/translators/merges","archive_url":"https://api.github.com/repos/zuphilip/translators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zuphilip/translators/downloads","issues_url":"https://api.github.com/repos/zuphilip/translators/issues{/number}","pulls_url":"https://api.github.com/repos/zuphilip/translators/pulls{/number}","milestones_url":"https://api.github.com/repos/zuphilip/translators/milestones{/number}","notifications_url":"https://api.github.com/repos/zuphilip/translators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zuphilip/translators/labels{/name}","releases_url":"https://api.github.com/repos/zuphilip/translators/releases{/id}","created_at":"2014-08-31T20:18:19Z","updated_at":"2015-03-15T15:03:09Z","pushed_at":"2015-03-16T21:15:19Z","git_url":"git://github.com/zuphilip/translators.git","ssh_url":"git@github.com:zuphilip/translators.git","clone_url":"https://github.com/zuphilip/translators.git","svn_url":"https://github.com/zuphilip/translators","homepage":"http://www.zotero.org/support/dev/translators","size":11390,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zotero:master","ref":"master","sha":"1161f813bec2621ba868b04b3fab2adb3509a8d5","user":{"login":"zotero","id":891917,"avatar_url":"https://avatars.githubusercontent.com/u/891917?v=3","gravatar_id":"","url":"https://api.github.com/users/zotero","html_url":"https://github.com/zotero","followers_url":"https://api.github.com/users/zotero/followers","following_url":"https://api.github.com/users/zotero/following{/other_user}","gists_url":"https://api.github.com/users/zotero/gists{/gist_id}","starred_url":"https://api.github.com/users/zotero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zotero/subscriptions","organizations_url":"https://api.github.com/users/zotero/orgs","repos_url":"https://api.github.com/users/zotero/repos","events_url":"https://api.github.com/users/zotero/events{/privacy}","received_events_url":"https://api.github.com/users/zotero/received_events","type":"Organization","site_admin":false},"repo":{"id":1991863,"name":"translators","full_name":"zotero/translators","owner":{"login":"zotero","id":891917,"avatar_url":"https://avatars.githubusercontent.com/u/891917?v=3","gravatar_id":"","url":"https://api.github.com/users/zotero","html_url":"https://github.com/zotero","followers_url":"https://api.github.com/users/zotero/followers","following_url":"https://api.github.com/users/zotero/following{/other_user}","gists_url":"https://api.github.com/users/zotero/gists{/gist_id}","starred_url":"https://api.github.com/users/zotero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zotero/subscriptions","organizations_url":"https://api.github.com/users/zotero/orgs","repos_url":"https://api.github.com/users/zotero/repos","events_url":"https://api.github.com/users/zotero/events{/privacy}","received_events_url":"https://api.github.com/users/zotero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zotero/translators","description":"Zotero Translators","fork":false,"url":"https://api.github.com/repos/zotero/translators","forks_url":"https://api.github.com/repos/zotero/translators/forks","keys_url":"https://api.github.com/repos/zotero/translators/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zotero/translators/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zotero/translators/teams","hooks_url":"https://api.github.com/repos/zotero/translators/hooks","issue_events_url":"https://api.github.com/repos/zotero/translators/issues/events{/number}","events_url":"https://api.github.com/repos/zotero/translators/events","assignees_url":"https://api.github.com/repos/zotero/translators/assignees{/user}","branches_url":"https://api.github.com/repos/zotero/translators/branches{/branch}","tags_url":"https://api.github.com/repos/zotero/translators/tags","blobs_url":"https://api.github.com/repos/zotero/translators/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zotero/translators/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zotero/translators/git/refs{/sha}","trees_url":"https://api.github.com/repos/zotero/translators/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zotero/translators/statuses/{sha}","languages_url":"https://api.github.com/repos/zotero/translators/languages","stargazers_url":"https://api.github.com/repos/zotero/translators/stargazers","contributors_url":"https://api.github.com/repos/zotero/translators/contributors","subscribers_url":"https://api.github.com/repos/zotero/translators/subscribers","subscription_url":"https://api.github.com/repos/zotero/translators/subscription","commits_url":"https://api.github.com/repos/zotero/translators/commits{/sha}","git_commits_url":"https://api.github.com/repos/zotero/translators/git/commits{/sha}","comments_url":"https://api.github.com/repos/zotero/translators/comments{/number}","issue_comment_url":"https://api.github.com/repos/zotero/translators/issues/comments{/number}","contents_url":"https://api.github.com/repos/zotero/translators/contents/{+path}","compare_url":"https://api.github.com/repos/zotero/translators/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zotero/translators/merges","archive_url":"https://api.github.com/repos/zotero/translators/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zotero/translators/downloads","issues_url":"https://api.github.com/repos/zotero/translators/issues{/number}","pulls_url":"https://api.github.com/repos/zotero/translators/pulls{/number}","milestones_url":"https://api.github.com/repos/zotero/translators/milestones{/number}","notifications_url":"https://api.github.com/repos/zotero/translators/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zotero/translators/labels{/name}","releases_url":"https://api.github.com/repos/zotero/translators/releases{/id}","created_at":"2011-07-03T17:40:38Z","updated_at":"2015-03-14T16:26:25Z","pushed_at":"2015-03-14T16:26:24Z","git_url":"git://github.com/zotero/translators.git","ssh_url":"git@github.com:zotero/translators.git","clone_url":"https://github.com/zotero/translators.git","svn_url":"https://github.com/zotero/translators","homepage":"http://www.zotero.org/support/dev/translators","size":16425,"stargazers_count":134,"watchers_count":134,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":115,"mirror_url":null,"open_issues_count":116,"forks":115,"open_issues":116,"watchers":134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zotero/translators/pulls/865"},"html":{"href":"https://github.com/zotero/translators/pull/865"},"issue":{"href":"https://api.github.com/repos/zotero/translators/issues/865"},"comments":{"href":"https://api.github.com/repos/zotero/translators/issues/865/comments"},"review_comments":{"href":"https://api.github.com/repos/zotero/translators/pulls/865/comments"},"review_comment":{"href":"https://api.github.com/repos/zotero/translators/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zotero/translators/pulls/865/commits"},"statuses":{"href":"https://api.github.com/repos/zotero/translators/statuses/04d713876383841193c37eb313e27625dc2837c5"}}}}