{"action":"created","issue":{"url":"https://api.github.com/repos/bfred-it/object-fit-images/issues/37","repository_url":"https://api.github.com/repos/bfred-it/object-fit-images","labels_url":"https://api.github.com/repos/bfred-it/object-fit-images/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/bfred-it/object-fit-images/issues/37/comments","events_url":"https://api.github.com/repos/bfred-it/object-fit-images/issues/37/events","html_url":"https://github.com/bfred-it/object-fit-images/issues/37","id":179310429,"number":37,"title":"Can you distribute a non-minified dist release?","user":{"login":"peteygao","id":2184561,"avatar_url":"https://avatars.githubusercontent.com/u/2184561?v=3","gravatar_id":"","url":"https://api.github.com/users/peteygao","html_url":"https://github.com/peteygao","followers_url":"https://api.github.com/users/peteygao/followers","following_url":"https://api.github.com/users/peteygao/following{/other_user}","gists_url":"https://api.github.com/users/peteygao/gists{/gist_id}","starred_url":"https://api.github.com/users/peteygao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteygao/subscriptions","organizations_url":"https://api.github.com/users/peteygao/orgs","repos_url":"https://api.github.com/users/peteygao/repos","events_url":"https://api.github.com/users/peteygao/events{/privacy}","received_events_url":"https://api.github.com/users/peteygao/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-26T19:01:56Z","updated_at":"2016-09-27T17:02:38Z","closed_at":"2016-09-27T00:17:42Z","body":"We're trying to use `ofi.browser.js` with an existing Rails project, but the built-in asset pipeline wants to _re_-minify all JS files, and unfortunately there seems to be some incompatibilities with our existing JS codebase and `ofi.browser.js`, which clobbers a function name in `ofi.browser.js` and throws a runtime exception.\r\n\r\nWith a non-minified dist .js, we can just let the Rails asset pipeline handle the minification process and hopefully avoid this issue."},"comment":{"url":"https://api.github.com/repos/bfred-it/object-fit-images/issues/comments/249929257","html_url":"https://github.com/bfred-it/object-fit-images/issues/37#issuecomment-249929257","issue_url":"https://api.github.com/repos/bfred-it/object-fit-images/issues/37","id":249929257,"user":{"login":"peteygao","id":2184561,"avatar_url":"https://avatars.githubusercontent.com/u/2184561?v=3","gravatar_id":"","url":"https://api.github.com/users/peteygao","html_url":"https://github.com/peteygao","followers_url":"https://api.github.com/users/peteygao/followers","following_url":"https://api.github.com/users/peteygao/following{/other_user}","gists_url":"https://api.github.com/users/peteygao/gists{/gist_id}","starred_url":"https://api.github.com/users/peteygao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peteygao/subscriptions","organizations_url":"https://api.github.com/users/peteygao/orgs","repos_url":"https://api.github.com/users/peteygao/repos","events_url":"https://api.github.com/users/peteygao/events{/privacy}","received_events_url":"https://api.github.com/users/peteygao/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T17:02:38Z","updated_at":"2016-09-27T17:02:38Z","body":"Sure, here's the output:\r\n```\r\nvar objectFitImages=function(){\"use strict\";function t(t,r){if(!t[s].parsingSrcset){var i=l(t);if(i[\"object-fit\"]=i[\"object-fit\"]||\"fill\",!t[s].s){if(\"fill\"===i[\"object-fit\"])return;if(!t[s].skipTest&&o&&!i[\"object-position\"])return}var c=t[s].ios7src||t.currentSrc||t.src;if(r)c=r;else if(t.srcset&&!a&&window.picturefill){var n=window.picturefill._.ns;t[s].parsingSrcset=!0,t[n]&&t[n].evaled||window.picturefill._.fillImg(t,{reselect:!0}),t[n].curSrc||(t[n].supported=!1,window.picturefill._.fillImg(t,{reselect:!0})),delete t[s].parsingSrcset,c=t[n].curSrc||c}if(t[s].s)t[s].s=c,r&&(t[s].srcAttr=r);else{t[s]={s:c,srcAttr:r||u.call(t,\"src\"),srcsetAttr:t.srcset},t.src=s;try{t.srcset&&(t.srcset=\"\",Object.defineProperty(t,\"srcset\",{value:t[s].srcsetAttr})),e(t)}catch(l){t[s].ios7src=c}}t.style.backgroundImage='url(\"'+c+'\")',t.style.backgroundPosition=i[\"object-position\"]||\"center\",t.style.backgroundRepeat=\"no-repeat\",/scale-down/.test(i[\"object-fit\"])?(t[s].i||(t[s].i=new Image,t[s].i.src=c),function f(){return t[s].i.naturalWidth?void(t.style.backgroundSize=t[s].i.naturalWidth>t.width||t[s].i.naturalHeight>t.height?\"contain\":\"auto\"):void setTimeout(f,100)}()):t.style.backgroundSize=i[\"object-fit\"].replace(\"none\",\"auto\").replace(\"fill\",\"100% 100%\")}}function e(e){var r={get:function(){return e[s].s},set:function(r){return delete e[s].i,t(e,r),r}};Object.defineProperty(e,\"src\",r),Object.defineProperty(e,\"currentSrc\",{get:r.get})}function r(){l||(HTMLImageElement.prototype.getAttribute=function(t){return!this[s]||\"src\"!==t&&\"srcset\"!==t?u.call(this,t):this[s][t+\"Attr\"]},HTMLImageElement.prototype.setAttribute=function(t,e){!this[s]||\"src\"!==t&&\"srcset\"!==t?f.call(this,t,e):this[\"src\"===t?\"src\":t+\"Attr\"]=String(e)})}function i(e,r){var c=!A&&!e;if(r=r||{},e=e||\"img\",l&&!r.skipTest)return!1;\"string\"==typeof e?e=document.querySelectorAll(\"img\"):e.length||(e=[e]);for(var n=0;n<e.length;n++)e[n][s]=e[n][s]||r,t(e[n]);c&&(document.body.addEventListener(\"load\",function(t){\"IMG\"===t.target.tagName&&i(t.target,{skipTest:r.skipTest})},!0),A=!0,e=\"img\"),r.watchMQ&&window.addEventListener(\"resize\",i.bind(null,e,{skipTest:r.skipTest}))}var s=\"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\",c=/(object-fit|object-position)\\s*:\\s*([-\\w\\s%]+)/g,n=new Image,o=\"object-fit\"in n.style,l=\"object-position\"in n.style,a=\"string\"==typeof n.currentSrc,u=n.getAttribute,f=n.setAttribute,A=!1;return i.supportsObjectFit=o,i.supportsObjectPosition=l,r(),i}();\r\n```\r\n\r\nThis file isn't even concatenated, it's simply passed through as a single vendor'd .js file into Sprockets' asset compilation pipeline and is rendered as a standalone file."}}
{"actor":{"display_login":"peteygao"}}