mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
36
extensions/markdown/media/loading.js
Normal file
36
extensions/markdown/media/loading.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// @ts-check
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
(function () {
|
||||
const unloadedStyles = [];
|
||||
|
||||
const onStyleLoadError = (event) => {
|
||||
const source = event.target.dataset.source;
|
||||
unloadedStyles.push(source);
|
||||
};
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
for (const link of document.getElementsByClassName('code-user-style')) {
|
||||
if (link.dataset.source) {
|
||||
link.onerror = onStyleLoadError;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
if (!unloadedStyles.length) {
|
||||
return;
|
||||
}
|
||||
const args = [unloadedStyles];
|
||||
window.parent.postMessage({
|
||||
command: 'did-click-link',
|
||||
data: `command:_markdown.onPreviewStyleLoadError?${encodeURIComponent(JSON.stringify(args))}`
|
||||
}, 'file://');
|
||||
});
|
||||
}());
|
||||
Reference in New Issue
Block a user