mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-22 03:35:31 -05:00
This MR brings in `$`, `$$`, and `$x` browsers devtools' utilities to our code so we can use these whenever we find it convenient.
This commit is contained in:
committed by
GitHub
parent
3a66be585f
commit
82613d016a
@@ -1,3 +1,5 @@
|
||||
import { $$ } from 'basic-devtools';
|
||||
|
||||
import { _createAlertBanner } from './exceptions';
|
||||
|
||||
export function addClasses(element: HTMLElement, classes: string[]) {
|
||||
@@ -101,7 +103,7 @@ export function createDeprecationWarning(msg: string, elementName: string): void
|
||||
* If null, the full text of 'msg' is used instead.
|
||||
*/
|
||||
export function createSingularWarning(msg: string, sentinelText: string | null = null): void {
|
||||
const banners = document.getElementsByClassName('alert-banner py-warning');
|
||||
const banners = $$('.alert-banner, .py-warning', document);
|
||||
let bannerCount = 0;
|
||||
for (const banner of banners) {
|
||||
if (banner.innerHTML.includes(sentinelText ? sentinelText : msg)) {
|
||||
|
||||
Reference in New Issue
Block a user