{"action":"created","issue":{"url":"https://api.github.com/repos/redoPop/loupe/issues/16","repository_url":"https://api.github.com/repos/redoPop/loupe","labels_url":"https://api.github.com/repos/redoPop/loupe/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/redoPop/loupe/issues/16/comments","events_url":"https://api.github.com/repos/redoPop/loupe/issues/16/events","html_url":"https://github.com/redoPop/loupe/issues/16","id":202072449,"number":16,"title":"Future request: Allow loupe image source to be encoded","user":{"login":"eliz82","id":1497398,"avatar_url":"https://avatars3.githubusercontent.com/u/1497398?v=4","gravatar_id":"","url":"https://api.github.com/users/eliz82","html_url":"https://github.com/eliz82","followers_url":"https://api.github.com/users/eliz82/followers","following_url":"https://api.github.com/users/eliz82/following{/other_user}","gists_url":"https://api.github.com/users/eliz82/gists{/gist_id}","starred_url":"https://api.github.com/users/eliz82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliz82/subscriptions","organizations_url":"https://api.github.com/users/eliz82/orgs","repos_url":"https://api.github.com/users/eliz82/repos","events_url":"https://api.github.com/users/eliz82/events{/privacy}","received_events_url":"https://api.github.com/users/eliz82/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"redoPop","id":109632,"avatar_url":"https://avatars2.githubusercontent.com/u/109632?v=4","gravatar_id":"","url":"https://api.github.com/users/redoPop","html_url":"https://github.com/redoPop","followers_url":"https://api.github.com/users/redoPop/followers","following_url":"https://api.github.com/users/redoPop/following{/other_user}","gists_url":"https://api.github.com/users/redoPop/gists{/gist_id}","starred_url":"https://api.github.com/users/redoPop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redoPop/subscriptions","organizations_url":"https://api.github.com/users/redoPop/orgs","repos_url":"https://api.github.com/users/redoPop/repos","events_url":"https://api.github.com/users/redoPop/events{/privacy}","received_events_url":"https://api.github.com/users/redoPop/received_events","type":"User","site_admin":false},"assignees":[{"login":"redoPop","id":109632,"avatar_url":"https://avatars2.githubusercontent.com/u/109632?v=4","gravatar_id":"","url":"https://api.github.com/users/redoPop","html_url":"https://github.com/redoPop","followers_url":"https://api.github.com/users/redoPop/followers","following_url":"https://api.github.com/users/redoPop/following{/other_user}","gists_url":"https://api.github.com/users/redoPop/gists{/gist_id}","starred_url":"https://api.github.com/users/redoPop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redoPop/subscriptions","organizations_url":"https://api.github.com/users/redoPop/orgs","repos_url":"https://api.github.com/users/redoPop/repos","events_url":"https://api.github.com/users/redoPop/events{/privacy}","received_events_url":"https://api.github.com/users/redoPop/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-01-20T07:35:45Z","updated_at":"2018-03-13T01:51:55Z","closed_at":"2018-03-13T01:51:55Z","author_association":"NONE","body":"Future request: Allow loupe image source to be encoded\r\nWhen loupe is used on sites that sell pictures it will be helpful if source of the big image is not in plain text\r\n\r\nhttps://github.com/redoPop/loupe/blob/master/loupe.js#L193\r\nreplace: newS = el.href;\r\nwith:  newS = atob(el.getAttribute('data-enc')) || el.href;\r\n\r\nthen in our source we can use php to encode. example loupe.php:\r\n`<a id=\"demo-1\" href=\"medium.jpg\" data-enc=\"<?php echo base64_encode('big.jpg');?>\">`\r\n  `<img src=\"small.jpg\" />`\r\n`</a>`\r\n\r\nwill generate: data-enc=\"YmlnLmpwZw==\" in the webpage\r\n\r\nif data-enc is not present then loupe will use the href , like in your version\r\n"},"comment":{"url":"https://api.github.com/repos/redoPop/loupe/issues/comments/372519619","html_url":"https://github.com/redoPop/loupe/issues/16#issuecomment-372519619","issue_url":"https://api.github.com/repos/redoPop/loupe/issues/16","id":372519619,"user":{"login":"redoPop","id":109632,"avatar_url":"https://avatars2.githubusercontent.com/u/109632?v=4","gravatar_id":"","url":"https://api.github.com/users/redoPop","html_url":"https://github.com/redoPop","followers_url":"https://api.github.com/users/redoPop/followers","following_url":"https://api.github.com/users/redoPop/following{/other_user}","gists_url":"https://api.github.com/users/redoPop/gists{/gist_id}","starred_url":"https://api.github.com/users/redoPop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redoPop/subscriptions","organizations_url":"https://api.github.com/users/redoPop/orgs","repos_url":"https://api.github.com/users/redoPop/repos","events_url":"https://api.github.com/users/redoPop/events{/privacy}","received_events_url":"https://api.github.com/users/redoPop/received_events","type":"User","site_admin":false},"created_at":"2018-03-13T01:51:55Z","updated_at":"2018-03-13T01:51:55Z","author_association":"OWNER","body":"I understand your request now. This isn't something I'd add to Loupe itself, but the `image` method could be overridden to perform the decoding or to return a value decoded elsewhere, e.g.:\r\n\r\n```\r\nconst loupe = new Loupe(document.getElementById('demo-1'));\r\nconst url = atob(loupe.el.getAttribute('data-enc'));\r\nloupe.image = () => url;\r\n```"}}
{"actor":{"display_login":"redoPop"}}