| 139 | } |
| 140 | |
| 141 | choc::ui::WebView::Options::Resource handleResourceRequest (const std::string& path) |
| 142 | { |
| 143 | choc::ui::WebView::Options::Resource resource; |
| 144 | |
| 145 | if (path == "/" || path == "/index.html") |
| 146 | { |
| 147 | auto html = getMainHTML(); |
| 148 | resource.data = std::vector<uint8_t>(html.begin(), html.end()); |
| 149 | resource.mimeType = "text/html"; |
| 150 | } |
| 151 | else if (path == "/style.css") |
| 152 | { |
| 153 | auto css = getCSS(); |
| 154 | resource.data = std::vector<uint8_t>(css.begin(), css.end()); |
| 155 | resource.mimeType = "text/css"; |
| 156 | } |
| 157 | else if (path == "/script.js") |
| 158 | { |
| 159 | auto js = getJavaScript(); |
| 160 | resource.data = std::vector<uint8_t>(js.begin(), js.end()); |
| 161 | resource.mimeType = "application/javascript"; |
| 162 | } |
| 163 | |
| 164 | return resource; |
| 165 | } |
| 166 | |
| 167 | void loadInitialContent() |
| 168 | { |
no test coverage detected