[IMP] devtools: Add a button to navigate to the doc
This commit adds a button to the devtools navbar which links to the documentation.
|
Before Width: | Height: | Size: 318 KiB After Width: | Height: | Size: 333 KiB |
|
Before Width: | Height: | Size: 199 KiB After Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 334 KiB After Width: | Height: | Size: 336 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 146 KiB |
@@ -77,6 +77,15 @@ browserInstance.runtime.onMessage.addListener(async (message, sender, sendRespon
|
|||||||
setOwlStatus(message.data);
|
setOwlStatus(message.data);
|
||||||
// Dummy message to test if the extension context is still valid
|
// Dummy message to test if the extension context is still valid
|
||||||
} else if (message.type === "keepAlive") {
|
} else if (message.type === "keepAlive") {
|
||||||
|
return;
|
||||||
|
// Open the devtools documentation in a new tab
|
||||||
|
} else if (message.type === "openDoc") {
|
||||||
|
browserInstance.tabs.create(
|
||||||
|
{ url: "https://github.com/odoo/owl/blob/master/doc/tools/devtools_guide.md", active: false },
|
||||||
|
function (tab) {
|
||||||
|
browserInstance.tabs.update(tab.id, { active: true });
|
||||||
|
}
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
// Relay the received message to the devtools app
|
// Relay the received message to the devtools app
|
||||||
} else if (message.type === "newDevtoolsPanel") {
|
} else if (message.type === "newDevtoolsPanel") {
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
<option t-att-value="frame"><t t-esc="frame"/></option>
|
<option t-att-value="frame"><t t-esc="frame"/></option>
|
||||||
</t>
|
</t>
|
||||||
</select>
|
</select>
|
||||||
<i class="ms-auto p-1 me-1 lg-icon fa pointer-icon" title="Toggle dark mode" t-att-class="{ 'fa-sun-o': store.settings.darkMode, 'fa-moon-o' : !store.settings.darkMode}" t-on-click.stop="() => this.store.toggleDarkMode()"></i>
|
<i class="ms-auto p-1 me-1 lg-icon fa fa-question-circle pointer-icon" title="Open devtools doc" t-on-click.stop="() => this.store.openDocumentation()"></i>
|
||||||
|
<i class="p-1 me-1 lg-icon fa pointer-icon" title="Toggle dark mode" t-att-class="{ 'fa-sun-o': store.settings.darkMode, 'fa-moon-o' : !store.settings.darkMode}" t-on-click.stop="() => this.store.toggleDarkMode()"></i>
|
||||||
<i class="p-1 me-1 lg-icon fa fa-repeat pointer-icon" title="Refresh extension" t-on-click.stop="() => this.store.refreshExtension()"></i>
|
<i class="p-1 me-1 lg-icon fa fa-repeat pointer-icon" title="Refresh extension" t-on-click.stop="() => this.store.refreshExtension()"></i>
|
||||||
</div>
|
</div>
|
||||||
<ComponentsTab t-if="store.page === 'ComponentsTab'"/>
|
<ComponentsTab t-if="store.page === 'ComponentsTab'"/>
|
||||||
|
|||||||
@@ -618,6 +618,10 @@ export const store = reactive({
|
|||||||
}
|
}
|
||||||
browserInstance.storage.local.set({ owl_devtools_dark_mode: this.settings.darkMode });
|
browserInstance.storage.local.set({ owl_devtools_dark_mode: this.settings.darkMode });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
openDocumentation() {
|
||||||
|
browserInstance.runtime.sendMessage({ type: "openDoc" });
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Instantiate the store
|
// Instantiate the store
|
||||||
|
|||||||