{"action":"created","issue":{"url":"https://api.github.com/repos/EagerIO/EmbedBox/issues/56","repository_url":"https://api.github.com/repos/EagerIO/EmbedBox","labels_url":"https://api.github.com/repos/EagerIO/EmbedBox/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/EagerIO/EmbedBox/issues/56/comments","events_url":"https://api.github.com/repos/EagerIO/EmbedBox/issues/56/events","html_url":"https://github.com/EagerIO/EmbedBox/issues/56","id":170922064,"number":56,"title":"Confusing behavior for `downloadURL` and `embedCode` both specified","user":{"login":"adamschwartz","id":154613,"avatar_url":"https://avatars.githubusercontent.com/u/154613?v=3","gravatar_id":"","url":"https://api.github.com/users/adamschwartz","html_url":"https://github.com/adamschwartz","followers_url":"https://api.github.com/users/adamschwartz/followers","following_url":"https://api.github.com/users/adamschwartz/following{/other_user}","gists_url":"https://api.github.com/users/adamschwartz/gists{/gist_id}","starred_url":"https://api.github.com/users/adamschwartz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamschwartz/subscriptions","organizations_url":"https://api.github.com/users/adamschwartz/orgs","repos_url":"https://api.github.com/users/adamschwartz/repos","events_url":"https://api.github.com/users/adamschwartz/events{/privacy}","received_events_url":"https://api.github.com/users/adamschwartz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-12T17:40:24Z","updated_at":"2016-08-12T21:59:30Z","closed_at":null,"body":"From the source:\r\n\r\n```javascript\r\n  get copyText() {\r\n    if (this.downloadURL) return `<script src=\"${this.downloadURL}\"></script>`\r\n\r\n    return this.config.embedCode || this.store.embedCode\r\n  }\r\n```\r\n\r\nThis is resulting in this for Weebly (on the homepage):\r\n\r\n![image](https://cloud.githubusercontent.com/assets/154613/17631148/d838d716-6090-11e6-8ac2-110fddb864f8.png)\r\n\r\nI’m thinking that maybe the logic here is backwards? Like if an `embedCode` is provided, use that, and only if there is no `embedCode` but there is a `downloadURL` should we revert to the concatenation?\r\n\r\nAlso, in the concatenation, we should probably strip the protocol, right? \r\nhttp://embed.books.eager.io/script-tag.html#https\r\n\r\ncc @zackbloom "},"comment":{"url":"https://api.github.com/repos/EagerIO/EmbedBox/issues/comments/239569997","html_url":"https://github.com/EagerIO/EmbedBox/issues/56#issuecomment-239569997","issue_url":"https://api.github.com/repos/EagerIO/EmbedBox/issues/56","id":239569997,"user":{"login":"TeffenEllis","id":592134,"avatar_url":"https://avatars.githubusercontent.com/u/592134?v=3","gravatar_id":"","url":"https://api.github.com/users/TeffenEllis","html_url":"https://github.com/TeffenEllis","followers_url":"https://api.github.com/users/TeffenEllis/followers","following_url":"https://api.github.com/users/TeffenEllis/following{/other_user}","gists_url":"https://api.github.com/users/TeffenEllis/gists{/gist_id}","starred_url":"https://api.github.com/users/TeffenEllis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeffenEllis/subscriptions","organizations_url":"https://api.github.com/users/TeffenEllis/orgs","repos_url":"https://api.github.com/users/TeffenEllis/repos","events_url":"https://api.github.com/users/TeffenEllis/events{/privacy}","received_events_url":"https://api.github.com/users/TeffenEllis/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T21:59:30Z","updated_at":"2016-08-12T21:59:30Z","body":"@adamschwartz, it's an interesting question.\r\n\r\nWe briefly chatted about what's the expected behavior when only a `downloadURL` is configured. My feeling is that a the config wide `downloadURL` is odd fitting since plugins are unique to targets. It should be scoped to the particular target. We already support scoped target configs overriding the global config 🐳 \r\n\r\nOur most basic config:\r\n\r\n```javascript\r\nnew EmbedBox({\r\n  embedCode: \"<script src='http://example.com/foo.js</script>\"\r\n})\r\n```\r\n\r\nThis example would only show targets that support an `embedCode` (all of them?)\r\n\r\nA plugin config:\r\n\r\n```javascript\r\nnew EmbedBox({\r\n  targets: {\r\n    wordpress: {\r\n      downloadURL: \"http://example.com/wordpress.zip\"\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nThis example would only show a single target, WordPress.\r\n\r\nThis also brings up our `visibleTargets` property. I'm leaning toward it being confusing. `visibleTargets` does double duty of visibility and ordering. @zackbloom suggested a `priority` option awhile back. I think it'd be uncommon for a developer to hide a particular target, but if needed that can be arranged.\r\n\r\n```javascript\r\nnew EmbedBox({\r\n  targets: {\r\n    wordpress: {\r\n      downloadURL: \"http://example.com/wordpress.zip\",\r\n      priority: 1\r\n    },\r\n    joomla: {\r\n      downloadURL: \"http://example.com/joomla.zip\",\r\n      priority: 2\r\n    },\r\n    wix: {\r\n      visible: false\r\n    }\r\n  }\r\n})\r\n```\r\n\r\nThoughts?"}}
{"actor":{"display_login":"TeffenEllis"}}