feat(docs): firefox browser compat
This commit is contained in:
+11
-11
@@ -11,9 +11,10 @@ var DOCS = {
|
||||
};
|
||||
|
||||
function openUrl(filePath) {
|
||||
var cmd = process.platform === 'win32'
|
||||
? 'start "" "' + filePath + '"'
|
||||
: 'xdg-open "' + filePath + '"';
|
||||
var cmd;
|
||||
if (process.platform === 'win32') cmd = 'start "" "' + filePath + '"';
|
||||
else if (process.platform === 'darwin') cmd = 'open "' + filePath + '"';
|
||||
else cmd = 'xdg-open "' + filePath + '"';
|
||||
|
||||
exec(cmd, function (err) {
|
||||
if (err) {
|
||||
@@ -24,7 +25,7 @@ function openUrl(filePath) {
|
||||
});
|
||||
}
|
||||
|
||||
function buildSelectionPage(javaPath, reactNativePath) {
|
||||
function buildSelectionPage() {
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
@@ -93,8 +94,7 @@ function buildSelectionPage(javaPath, reactNativePath) {
|
||||
gap: 14px;
|
||||
padding: 18px 22px;
|
||||
border-radius: 12px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
transition: transform 0.15s, box-shadow 0.15s;
|
||||
@@ -163,7 +163,7 @@ function buildSelectionPage(javaPath, reactNativePath) {
|
||||
<p class="subtitle">Selecione abaixo qual documentação você deseja consultar.</p>
|
||||
|
||||
<div class="buttons">
|
||||
<button class="btn btn-primary" onclick="window.location.href='file://${javaPath}'">
|
||||
<a class="btn btn-primary" href="docs/java/index.html">
|
||||
<span class="btn-icon">
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm-1 16H5V5h14v14zM7 12h2v5H7zm4-3h2v8h-2zm4-3h2v11h-2z"/>
|
||||
@@ -173,9 +173,9 @@ function buildSelectionPage(javaPath, reactNativePath) {
|
||||
Desktop (Java)
|
||||
<small>API do módulo desktop / back-end</small>
|
||||
</span>
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<button class="btn btn-secondary" onclick="window.location.href='file://${reactNativePath}'">
|
||||
<a class="btn btn-secondary" href="docs/react-native/index.html">
|
||||
<span class="btn-icon">
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M17 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 15H7V5h10v12zm-4 3h-2v-1h2v1z"/>
|
||||
@@ -185,7 +185,7 @@ function buildSelectionPage(javaPath, reactNativePath) {
|
||||
Mobile (React Native)
|
||||
<small>API do módulo mobile</small>
|
||||
</span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<footer>Vitruvio CLI — documentação local</footer>
|
||||
@@ -240,7 +240,7 @@ function register(program) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var html = buildSelectionPage(javaPath, reactNativePath);
|
||||
var html = buildSelectionPage();
|
||||
var tmpFile = path.join(platformDir, 'docs-selector.html');
|
||||
fs.writeFileSync(tmpFile, html, 'utf8');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user