(url)
| 159 | |
| 160 | var TEMPLATE_MARKER = "/*use-itty-bitty-template*/"; |
| 161 | function fetchCodepen(url) { |
| 162 | var h, c, j; |
| 163 | $.when( |
| 164 | $.get({ url: url + ".html", cache: false }, function(html) { |
| 165 | h = html; |
| 166 | }), |
| 167 | $.get({ url: url + ".css", cache: false }, function(css) { |
| 168 | c = css; |
| 169 | }), |
| 170 | $.get({ url: url + ".js", cache: false }, function(js) { |
| 171 | j = js; |
| 172 | }) |
| 173 | ).then(function() { |
| 174 | var useTemplate = c.indexOf(TEMPLATE_MARKER) >= 0; |
| 175 | var string = |
| 176 | '<style type="text/css">' + |
| 177 | c + |
| 178 | "</style>" + |
| 179 | h + |
| 180 | '<script type="text/javascript">' + |
| 181 | j + |
| 182 | "</script>"; |
| 183 | stringToZip(string, function(zip) { |
| 184 | setFileName("✒️" + url); |
| 185 | var title = QS("#doc-title").innerText; |
| 186 | setTimeout(function() { |
| 187 | var data = (useTemplate ? "" : DATA_PREFIX_BXZE) + zip; |
| 188 | importedFileData = data; |
| 189 | updateLink(data, title); |
| 190 | }, 300); |
| 191 | }); |
| 192 | }); |
| 193 | } |
| 194 | |
| 195 | function handleInput(e) { |
| 196 | updateBodyClass(); |
no test coverage detected