{"action":"closed","issue":{"url":"https://api.github.com/repos/Story-Worldwide/story-share/issues/7","labels_url":"https://api.github.com/repos/Story-Worldwide/story-share/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Story-Worldwide/story-share/issues/7/comments","events_url":"https://api.github.com/repos/Story-Worldwide/story-share/issues/7/events","html_url":"https://github.com/Story-Worldwide/story-share/issues/7","id":91043073,"number":7,"title":"`relativeMediaUrls: true` should default to the current page's directory","user":{"login":"goodguyry","id":2059404,"avatar_url":"https://avatars.githubusercontent.com/u/2059404?v=3","gravatar_id":"","url":"https://api.github.com/users/goodguyry","html_url":"https://github.com/goodguyry","followers_url":"https://api.github.com/users/goodguyry/followers","following_url":"https://api.github.com/users/goodguyry/following{/other_user}","gists_url":"https://api.github.com/users/goodguyry/gists{/gist_id}","starred_url":"https://api.github.com/users/goodguyry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goodguyry/subscriptions","organizations_url":"https://api.github.com/users/goodguyry/orgs","repos_url":"https://api.github.com/users/goodguyry/repos","events_url":"https://api.github.com/users/goodguyry/events{/privacy}","received_events_url":"https://api.github.com/users/goodguyry/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"matgargano","id":197298,"avatar_url":"https://avatars.githubusercontent.com/u/197298?v=3","gravatar_id":"","url":"https://api.github.com/users/matgargano","html_url":"https://github.com/matgargano","followers_url":"https://api.github.com/users/matgargano/followers","following_url":"https://api.github.com/users/matgargano/following{/other_user}","gists_url":"https://api.github.com/users/matgargano/gists{/gist_id}","starred_url":"https://api.github.com/users/matgargano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matgargano/subscriptions","organizations_url":"https://api.github.com/users/matgargano/orgs","repos_url":"https://api.github.com/users/matgargano/repos","events_url":"https://api.github.com/users/matgargano/events{/privacy}","received_events_url":"https://api.github.com/users/matgargano/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-06-25T18:37:37Z","updated_at":"2015-10-22T02:48:45Z","closed_at":"2015-10-22T02:48:45Z","body":"With the default `relativeMediaUrls` value being `true`, given `data-media=\"some-image.jpg\"` on a page at http://example.com/some-dir/, storyShare will pick the image up from `http://example.com/some-dir/some-image.jpg`.\r\n\r\nThe problem arises when the page is at `http://example.com/some-dir/filename.html`. In this scenario, storyShare expects the image to be located at `http://example.com/some-dir/filename.htmlsome-image.jpg`.\r\n\r\nMaybe check for a trailing slash or '.' and remove the filename?\r\n\r\n```javascript\r\nvar url = window.location.href,\r\n    end = url.split('/').pop();\r\n\r\nif (end.search(/\\./) > -1 || end.slice(-1) !== '/') {\r\n    url = url.substring(0, url.length - (end.length));\r\n}\r\n```\r\n\r\nJust a thought. There may be issues and edge cases with this approach that I'm not thinking about right now."}}