We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing #48453
import * as vscode from 'vscode'; const cats = { 'Coding Cat': 'https://media.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif', 'Compiling Cat':'https://media.giphy.com/media/mlvseq9yvZhba/giphy.gif' }; export function activate(context: vscode.ExtensionContext) { let panel: vscode.WebviewPanel; context.subscriptions.push(vscode.commands.registerCommand('catCoding.start', () => { panel = vscode.window.createWebviewPanel('catCoding', "Cat Coding", vscode.ViewColumn.One, {}); let iteration = 0; const updateWebview = () => { const cat = iteration++ % 2 ? 'Compiling Cat' : 'Coding Cat' panel.title = cat; panel.webview.html = getWebviewContent(cat); } updateWebview(); const interval = setInterval(updateWebview, 1000); panel.onDidDispose(() => { // When the panel is closed, cancel any future updates to the webview content clearInterval(interval); }, null, context.subscriptions) })); context.subscriptions.push(vscode.commands.registerCommand('catCoding.test', () => { panel.reveal(); })); } function getWebviewContent(cat: keyof typeof cats) { return `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Cat Coding</title> </head> <body> <img src="${cats[cat]}" width="300" /> </body> </html>`; }
The text was updated successfully, but these errors were encountered:
6091135
mjbvz
No branches or pull requests
Testing #48453
The text was updated successfully, but these errors were encountered: