webdav.client 5.21.6001 → 5.21.6101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ITHitWebDAVClient.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/Help/ClassReference/Create.html +0 -1809
- package/Help/ClassReference/ITHit.Environment.html +0 -1739
- package/Help/ClassReference/ITHit.LogLevel.html +0 -1985
- package/Help/ClassReference/ITHit.Logger.html +0 -2170
- package/Help/ClassReference/ITHit.WebDAV.Client.AsyncResult.html +0 -1877
- package/Help/ClassReference/ITHit.WebDAV.Client.BrowserExtension.html +0 -2282
- package/Help/ClassReference/ITHit.WebDAV.Client.CancellableResult.html +0 -2049
- package/Help/ClassReference/ITHit.WebDAV.Client.DavConstants.html +0 -3181
- package/Help/ClassReference/ITHit.WebDAV.Client.Depth.html +0 -1815
- package/Help/ClassReference/ITHit.WebDAV.Client.DocManager.html +0 -3600
- package/Help/ClassReference/ITHit.WebDAV.Client.Encoder.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.Error.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.BadRequestException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.ConflictException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.DependencyFailedException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.ForbiddenException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.Error.html +0 -1753
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.Multistatus.html +0 -1703
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.MultistatusResponse.html +0 -1703
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.PropertyMultistatus.html +0 -1755
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.PropertyMultistatusResponse.html +0 -1703
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.InsufficientStorageException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.IntegrationException.html +0 -1689
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.LockedException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.MethodNotAllowedException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.NotFoundException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.NotImplementedException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Parsers.InsufficientStorage.html +0 -1805
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PreconditionFailedException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyConflictException.html +0 -1929
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyException.html +0 -1929
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyForbiddenException.html +0 -1929
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyNotFoundException.html +0 -1929
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.QuotaNotExceededException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.SufficientDiskSpaceException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.UnauthorizedException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.WebDavException.html +0 -1695
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.WebDavHttpException.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.Features.html +0 -2215
- package/Help/ClassReference/ITHit.WebDAV.Client.File.html +0 -9490
- package/Help/ClassReference/ITHit.WebDAV.Client.Folder.html +0 -11459
- package/Help/ClassReference/ITHit.WebDAV.Client.GEditInfo.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.HierarchyItem.html +0 -8324
- package/Help/ClassReference/ITHit.WebDAV.Client.HttpStatus.html +0 -3861
- package/Help/ClassReference/ITHit.WebDAV.Client.LockInfo.html +0 -1923
- package/Help/ClassReference/ITHit.WebDAV.Client.LockScope.html +0 -1755
- package/Help/ClassReference/ITHit.WebDAV.Client.LockUriTokenPair.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.CancelUpload.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.CopyMove.html +0 -1745
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Delete.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.ErrorResponse.html +0 -1751
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Get.GoAsync.html +0 -1830
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Get.html +0 -1698
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Head.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.HttpMethod.html +0 -1765
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Lock.Go.html +0 -1866
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Lock.GoAsync.html +0 -1884
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Lock.html +0 -1701
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.LockRefresh.Go.html +0 -1866
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.LockRefresh.GoAsync.html +0 -1884
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.LockRefresh.html +0 -1701
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Mkcol.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.MultiResponse.html +0 -1751
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Options.html +0 -1748
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Propfind.html +0 -1745
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Proppatch.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Propstat.html +0 -1733
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Put.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Report.html +0 -1761
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Response.html +0 -1751
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.ResponseFactory.html +0 -1689
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Search.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.SingleResponse.html +0 -1742
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Undelete.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Unlock.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.UpdateToVersion.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.VersionControl.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.MsOfficeEditExtensions.html +0 -2103
- package/Help/ClassReference/ITHit.WebDAV.Client.Multistatus.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.MultistatusResponse.html +0 -1831
- package/Help/ClassReference/ITHit.WebDAV.Client.OptionsInfo.html +0 -1739
- package/Help/ClassReference/ITHit.WebDAV.Client.OrderProperty.html +0 -1960
- package/Help/ClassReference/ITHit.WebDAV.Client.PageResults.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.Property.html +0 -2017
- package/Help/ClassReference/ITHit.WebDAV.Client.PropertyList.html +0 -2048
- package/Help/ClassReference/ITHit.WebDAV.Client.PropertyMultistatusResponse.html +0 -1883
- package/Help/ClassReference/ITHit.WebDAV.Client.PropertyName.html +0 -1972
- package/Help/ClassReference/ITHit.WebDAV.Client.Request.html +0 -2673
- package/Help/ClassReference/ITHit.WebDAV.Client.RequestProgress.html +0 -1969
- package/Help/ClassReference/ITHit.WebDAV.Client.ResourceType.html +0 -1755
- package/Help/ClassReference/ITHit.WebDAV.Client.ResumableUpload.html +0 -2271
- package/Help/ClassReference/ITHit.WebDAV.Client.SPSManager.html +0 -1951
- package/Help/ClassReference/ITHit.WebDAV.Client.SearchQuery.html +0 -1974
- package/Help/ClassReference/ITHit.WebDAV.Client.Source.html +0 -1785
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.DocManager.MsOfficeEditExtensions.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Delete.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetFolderItems.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetHeadRequests.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetItemByFolder.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetItemBySession.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetParent.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.ItemExists.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.MicrosoftOfficeDiscovery.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.NameCheck.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Progress.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Refresh.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Search.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.SupportedFeatures.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyProperties.GetProperties.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyProperties.UpdateProperties.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.CheckSupport.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.Etag.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.GetLocks.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.Lock.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.RefreshLock.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.GetVersions.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.ManageVersions.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.PutUnderVersion.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.ReadContent.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.WebDavSession.Events.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.AutoUploader.html +0 -1753
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Collections.Map.html +0 -1916
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Collections.Pair.html +0 -1787
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.ContentWriter.html +0 -1945
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.DropZone.html +0 -1791
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.FSEntryFactory.html +0 -1689
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.HtmlControl.html +0 -1781
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.Input.html +0 -1791
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.DropZoneCollection.html +0 -2140
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.AsyncEvent.html +0 -1884
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.BaseEvent.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.BeforeUploadStarted.html +0 -2030
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.Error.html +0 -1695
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.EventName.html +0 -1843
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.ProgressChanged.html +0 -1791
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.QueueChanged.html +0 -1787
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.StateChanged.html +0 -1791
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.UploadError.html +0 -2174
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.UploadItemsCreated.html +0 -2150
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.FSEntry.html +0 -1823
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.FileSpan.html +0 -1806
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Groups.Group.html +0 -1761
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Groups.GroupManager.html +0 -1803
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.InputCollection.html +0 -2140
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.ItemSettings.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Path.Generator.html +0 -1888
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Path.PathCache.html +0 -1693
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Progress.html +0 -1969
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Providers.ProgressTracker.html +0 -1744
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Providers.UploadDiff.html +0 -1786
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Providers.UploadProvider.html +0 -1832
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Queue.html +0 -2618
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.ServerItem.html +0 -1761
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Settings.html +0 -1840
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.State.html +0 -2031
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.BaseState.html +0 -1685
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.CanceledState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.CompletedState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.Factory.html +0 -1689
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.PausedState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.QueuedState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.ResumeState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.SkippedState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.UploadingState.html +0 -1691
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.UploadItem.html +0 -5087
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.UploadLocation.html +0 -1761
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Uploader.html +0 -2106
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.UploaderSession.html +0 -3304
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Utils.DavUrl.html +0 -1779
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Utils.DavUrlBuilder.html +0 -1744
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Utils.RepeatableAction.html +0 -1863
- package/Help/ClassReference/ITHit.WebDAV.Client.UploadProgressInfo.html +0 -1877
- package/Help/ClassReference/ITHit.WebDAV.Client.Version.html +0 -3357
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavRequest.html +0 -1689
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavResponse.html +0 -1689
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavSession.html +0 -4046
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavUtil.html +0 -1689
- package/Help/ClassReference/data/search.json +0 -1
- package/Help/ClassReference/fonts/Inconsolata-Regular.ttf +0 -0
- package/Help/ClassReference/fonts/OpenSans-Regular.ttf +0 -0
- package/Help/ClassReference/fonts/WorkSans-Bold.ttf +0 -0
- package/Help/ClassReference/global.html +0 -7914
- package/Help/ClassReference/index.html +0 -2408
- package/Help/ClassReference/scripts/core.js +0 -710
- package/Help/ClassReference/scripts/core.min.js +0 -23
- package/Help/ClassReference/scripts/resize.js +0 -90
- package/Help/ClassReference/scripts/search.js +0 -265
- package/Help/ClassReference/scripts/search.min.js +0 -6
- package/Help/ClassReference/scripts/third-party/Apache-License-2.0.txt +0 -202
- package/Help/ClassReference/scripts/third-party/fuse.js +0 -9
- package/Help/ClassReference/scripts/third-party/hljs-line-num-original.js +0 -369
- package/Help/ClassReference/scripts/third-party/hljs-line-num.js +0 -1
- package/Help/ClassReference/scripts/third-party/hljs-original.js +0 -5171
- package/Help/ClassReference/scripts/third-party/hljs.js +0 -1
- package/Help/ClassReference/scripts/third-party/jquery.min.js +0 -6
- package/Help/ClassReference/scripts/third-party/popper.js +0 -5
- package/Help/ClassReference/scripts/third-party/tippy.js +0 -1
- package/Help/ClassReference/scripts/third-party/tocbot.js +0 -683
- package/Help/ClassReference/scripts/third-party/tocbot.min.js +0 -1
- package/Help/ClassReference/styles/clean-jsdoc-theme-base.css +0 -1053
- package/Help/ClassReference/styles/clean-jsdoc-theme-dark.css +0 -418
- package/Help/ClassReference/styles/clean-jsdoc-theme-light.css +0 -399
- package/Help/ClassReference/styles/clean-jsdoc-theme.min.css +0 -1
|
@@ -1,710 +0,0 @@
|
|
|
1
|
-
/* global document */
|
|
2
|
-
var accordionLocalStorageKey = 'accordion-id';
|
|
3
|
-
var themeLocalStorageKey = 'theme';
|
|
4
|
-
var fontSizeLocalStorageKey = 'font-size';
|
|
5
|
-
var html = document.querySelector('html');
|
|
6
|
-
|
|
7
|
-
var MAX_FONT_SIZE = 30;
|
|
8
|
-
var MIN_FONT_SIZE = 10;
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line no-undef
|
|
11
|
-
var localStorage = window.localStorage;
|
|
12
|
-
|
|
13
|
-
function getTheme() {
|
|
14
|
-
var body = document.body;
|
|
15
|
-
|
|
16
|
-
return body.getAttribute('data-theme');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function updateTheme(theme) {
|
|
20
|
-
var body = document.body;
|
|
21
|
-
var svgUse = document.querySelectorAll('.theme-svg-use');
|
|
22
|
-
var iconID = theme === 'dark' ? '#light-theme-icon' : '#dark-theme-icon';
|
|
23
|
-
|
|
24
|
-
body.setAttribute('data-theme', theme);
|
|
25
|
-
body.classList.remove('dark', 'light');
|
|
26
|
-
body.classList.add(theme);
|
|
27
|
-
|
|
28
|
-
svgUse.forEach(function (svg) {
|
|
29
|
-
svg.setAttribute('xlink:href', iconID);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
localStorage.setItem(themeLocalStorageKey, theme);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function toggleTheme() {
|
|
36
|
-
var body = document.body;
|
|
37
|
-
var theme = body.getAttribute('data-theme');
|
|
38
|
-
|
|
39
|
-
var newTheme = theme === 'dark' ? 'light' : 'dark';
|
|
40
|
-
|
|
41
|
-
updateTheme(newTheme);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
(function () {
|
|
45
|
-
var theme = getTheme();
|
|
46
|
-
|
|
47
|
-
var themeStoredInLocalStorage = localStorage.getItem(themeLocalStorageKey);
|
|
48
|
-
|
|
49
|
-
if (themeStoredInLocalStorage) {
|
|
50
|
-
if (theme === themeStoredInLocalStorage) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
updateTheme(themeStoredInLocalStorage);
|
|
55
|
-
} else {
|
|
56
|
-
localStorage.setItem(themeLocalStorageKey, theme);
|
|
57
|
-
}
|
|
58
|
-
})();
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Function to set accordion id to localStorage.
|
|
62
|
-
* @param {string} id Accordion id
|
|
63
|
-
*/
|
|
64
|
-
function setAccordionIdToLocalStorage(id) {
|
|
65
|
-
/**
|
|
66
|
-
* @type {object}
|
|
67
|
-
*/
|
|
68
|
-
var ids = JSON.parse(localStorage.getItem(accordionLocalStorageKey));
|
|
69
|
-
|
|
70
|
-
ids[id] = id;
|
|
71
|
-
localStorage.setItem(accordionLocalStorageKey, JSON.stringify(ids));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Function to remove accordion id from localStorage.
|
|
76
|
-
* @param {string} id Accordion id
|
|
77
|
-
*/
|
|
78
|
-
function removeAccordionIdFromLocalStorage(id) {
|
|
79
|
-
/**
|
|
80
|
-
* @type {object}
|
|
81
|
-
*/
|
|
82
|
-
var ids = JSON.parse(localStorage.getItem(accordionLocalStorageKey));
|
|
83
|
-
|
|
84
|
-
delete ids[id];
|
|
85
|
-
localStorage.setItem(accordionLocalStorageKey, JSON.stringify(ids));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Function to get all accordion ids from localStorage.
|
|
90
|
-
*
|
|
91
|
-
* @returns {object}
|
|
92
|
-
*/
|
|
93
|
-
function getAccordionIdsFromLocalStorage() {
|
|
94
|
-
/**
|
|
95
|
-
* @type {object}
|
|
96
|
-
*/
|
|
97
|
-
var ids = JSON.parse(localStorage.getItem(accordionLocalStorageKey));
|
|
98
|
-
|
|
99
|
-
return ids || {};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function toggleAccordion(element) {
|
|
103
|
-
var currentNode = element;
|
|
104
|
-
var isCollapsed = currentNode.getAttribute('data-isopen') === 'false';
|
|
105
|
-
|
|
106
|
-
if (isCollapsed) {
|
|
107
|
-
currentNode.setAttribute('data-isopen', 'true');
|
|
108
|
-
setAccordionIdToLocalStorage(currentNode.id);
|
|
109
|
-
} else {
|
|
110
|
-
currentNode.setAttribute('data-isopen', 'false');
|
|
111
|
-
removeAccordionIdFromLocalStorage(currentNode.id);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function initAccordion() {
|
|
116
|
-
if (
|
|
117
|
-
localStorage.getItem(accordionLocalStorageKey) === undefined ||
|
|
118
|
-
localStorage.getItem(accordionLocalStorageKey) === null
|
|
119
|
-
) {
|
|
120
|
-
localStorage.setItem(accordionLocalStorageKey, '{}');
|
|
121
|
-
}
|
|
122
|
-
var allAccordion = document.querySelectorAll('.sidebar-section-title');
|
|
123
|
-
var ids = getAccordionIdsFromLocalStorage();
|
|
124
|
-
|
|
125
|
-
allAccordion.forEach(function (item) {
|
|
126
|
-
item.addEventListener('click', function () {
|
|
127
|
-
toggleAccordion(item);
|
|
128
|
-
});
|
|
129
|
-
if (item.id in ids) {
|
|
130
|
-
toggleAccordion(item);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function isSourcePage() {
|
|
136
|
-
return Boolean(document.querySelector('#source-page'));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function bringElementIntoView(element, updateHistory = true) {
|
|
140
|
-
// If element is null then we are not going further
|
|
141
|
-
if (!element) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* tocbotInstance is defined in layout.tmpl
|
|
147
|
-
* It is defined when we are initializing tocbot.
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
// eslint-disable-next-line no-undef
|
|
151
|
-
if (tocbotInstance) {
|
|
152
|
-
// eslint-disable-next-line no-undef
|
|
153
|
-
setTimeout(() => tocbotInstance.updateTocListActiveElement(element), 60)
|
|
154
|
-
}
|
|
155
|
-
var navbar = document.querySelector('.navbar-container');
|
|
156
|
-
var body = document.querySelector('.main-content');
|
|
157
|
-
var elementTop = element.getBoundingClientRect().top;
|
|
158
|
-
|
|
159
|
-
var offset = 16;
|
|
160
|
-
|
|
161
|
-
if (navbar) {
|
|
162
|
-
offset += navbar.scrollHeight;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (body) {
|
|
166
|
-
body.scrollBy(0, elementTop - offset);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (updateHistory) {
|
|
170
|
-
// eslint-disable-next-line no-undef
|
|
171
|
-
history.pushState(null, null, '#' + element.id);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// eslint-disable-next-line no-unused-vars
|
|
176
|
-
function bringLinkToView(event) {
|
|
177
|
-
event.preventDefault();
|
|
178
|
-
event.stopPropagation();
|
|
179
|
-
var id = event.currentTarget.getAttribute('href');
|
|
180
|
-
|
|
181
|
-
if (!id) {
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
var element = document.getElementById(id.slice(1));
|
|
186
|
-
|
|
187
|
-
if (element) {
|
|
188
|
-
bringElementIntoView(element);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function bringIdToViewOnMount() {
|
|
193
|
-
if (isSourcePage()) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// eslint-disable-next-line no-undef
|
|
198
|
-
var id = window.location.hash;
|
|
199
|
-
|
|
200
|
-
if (id === '') {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
var element = document.getElementById(id.slice(1));
|
|
205
|
-
|
|
206
|
-
if (!element) {
|
|
207
|
-
id = decodeURI(id);
|
|
208
|
-
element = document.getElementById(id.slice(1));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (element) {
|
|
212
|
-
bringElementIntoView(element, false);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function createAnchorElement(id) {
|
|
217
|
-
var anchor = document.createElement('a');
|
|
218
|
-
|
|
219
|
-
anchor.textContent = '#';
|
|
220
|
-
anchor.href = '#' + id;
|
|
221
|
-
anchor.classList.add('link-anchor');
|
|
222
|
-
anchor.onclick = bringLinkToView;
|
|
223
|
-
|
|
224
|
-
return anchor;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function addAnchor() {
|
|
228
|
-
var main = document.querySelector('.main-content').querySelector('section');
|
|
229
|
-
|
|
230
|
-
var h1 = main.querySelectorAll('h1');
|
|
231
|
-
var h2 = main.querySelectorAll('h2');
|
|
232
|
-
var h3 = main.querySelectorAll('h3');
|
|
233
|
-
var h4 = main.querySelectorAll('h4');
|
|
234
|
-
|
|
235
|
-
var targets = [h1, h2, h3, h4];
|
|
236
|
-
|
|
237
|
-
targets.forEach(function (target) {
|
|
238
|
-
target.forEach(function (heading) {
|
|
239
|
-
var anchor = createAnchorElement(heading.id);
|
|
240
|
-
|
|
241
|
-
heading.classList.add('has-anchor');
|
|
242
|
-
heading.append(anchor);
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
*
|
|
249
|
-
* @param {string} value
|
|
250
|
-
*/
|
|
251
|
-
function copy(value) {
|
|
252
|
-
console.log(value);
|
|
253
|
-
const el = document.createElement('textarea');
|
|
254
|
-
|
|
255
|
-
el.value = value;
|
|
256
|
-
document.body.appendChild(el);
|
|
257
|
-
el.select();
|
|
258
|
-
document.execCommand('copy');
|
|
259
|
-
document.body.removeChild(el);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
function showTooltip(id) {
|
|
263
|
-
var tooltip = document.getElementById(id);
|
|
264
|
-
|
|
265
|
-
tooltip.classList.add('show-tooltip');
|
|
266
|
-
setTimeout(function () {
|
|
267
|
-
tooltip.classList.remove('show-tooltip');
|
|
268
|
-
}, 3000);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/* eslint-disable-next-line */
|
|
272
|
-
function copyFunction(id) {
|
|
273
|
-
// selecting the pre element
|
|
274
|
-
var code = document.getElementById(id);
|
|
275
|
-
|
|
276
|
-
// selecting the ol.linenums
|
|
277
|
-
var element = code.querySelector('.linenums');
|
|
278
|
-
|
|
279
|
-
if (!element) {
|
|
280
|
-
// selecting the code block
|
|
281
|
-
element = code.querySelector('code');
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// copy
|
|
285
|
-
copy(element.innerText.trim().replace(/(^\t)/gm, ''));
|
|
286
|
-
|
|
287
|
-
// show tooltip
|
|
288
|
-
showTooltip('tooltip-' + id);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function hideTocOnSourcePage() {
|
|
292
|
-
if (isSourcePage()) {
|
|
293
|
-
document.querySelector('.toc-container').style.display = 'none';
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function getPreTopBar(id, lang = '') {
|
|
298
|
-
// tooltip
|
|
299
|
-
var tooltip = '<div class="tooltip" id="tooltip-' + id + '">Copied!</div>';
|
|
300
|
-
|
|
301
|
-
// template of copy to clipboard icon container
|
|
302
|
-
var copyToClipboard =
|
|
303
|
-
'<button aria-label="copy code" class="icon-button copy-code" onclick="copyFunction(\'' +
|
|
304
|
-
id +
|
|
305
|
-
'\')"><svg class="sm-icon" alt="click to copy"><use xlink:href="#copy-icon"></use></svg>' +
|
|
306
|
-
tooltip +
|
|
307
|
-
'</button>';
|
|
308
|
-
|
|
309
|
-
var langNameDiv =
|
|
310
|
-
'<div class="code-lang-name-container"><div class="code-lang-name">' +
|
|
311
|
-
lang.toLocaleUpperCase() +
|
|
312
|
-
'</div></div>';
|
|
313
|
-
|
|
314
|
-
var topBar =
|
|
315
|
-
'<div class="pre-top-bar-container">' +
|
|
316
|
-
langNameDiv +
|
|
317
|
-
copyToClipboard +
|
|
318
|
-
'</div>';
|
|
319
|
-
|
|
320
|
-
return topBar;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
function getPreDiv() {
|
|
324
|
-
var divElement = document.createElement('div');
|
|
325
|
-
|
|
326
|
-
divElement.classList.add('pre-div');
|
|
327
|
-
|
|
328
|
-
return divElement;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
function processAllPre() {
|
|
332
|
-
var targets = document.querySelectorAll('pre');
|
|
333
|
-
var footer = document.querySelector('#PeOAagUepe');
|
|
334
|
-
var navbar = document.querySelector('#VuAckcnZhf');
|
|
335
|
-
|
|
336
|
-
var navbarHeight = 0;
|
|
337
|
-
var footerHeight = 0;
|
|
338
|
-
|
|
339
|
-
if (footer) {
|
|
340
|
-
footerHeight = footer.getBoundingClientRect().height;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
if (navbar) {
|
|
344
|
-
navbarHeight = navbar.getBoundingClientRect().height;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// eslint-disable-next-line no-undef
|
|
348
|
-
var preMaxHeight = window.innerHeight - navbarHeight - footerHeight - 250;
|
|
349
|
-
|
|
350
|
-
targets.forEach(function (pre, idx) {
|
|
351
|
-
var parent = pre.parentNode;
|
|
352
|
-
|
|
353
|
-
if (parent && parent.getAttribute('data-skip-pre-process') === 'true') {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
var div = getPreDiv();
|
|
358
|
-
var id = 'ScDloZOMdL' + idx;
|
|
359
|
-
|
|
360
|
-
var lang = pre.getAttribute('data-lang') || 'code';
|
|
361
|
-
var topBar = getPreTopBar(id, lang);
|
|
362
|
-
|
|
363
|
-
div.innerHTML = topBar;
|
|
364
|
-
|
|
365
|
-
//pre.style.maxHeight = preMaxHeight + 'px';
|
|
366
|
-
pre.id = id;
|
|
367
|
-
pre.classList.add('prettyprint');
|
|
368
|
-
pre.parentNode.insertBefore(div, pre);
|
|
369
|
-
div.appendChild(pre);
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function highlightAndBringLineIntoView() {
|
|
374
|
-
// eslint-disable-next-line no-undef
|
|
375
|
-
var lineNumber = window.location.hash.replace('#line', '');
|
|
376
|
-
|
|
377
|
-
try {
|
|
378
|
-
var selector = '[data-line-number="' + lineNumber + '"';
|
|
379
|
-
|
|
380
|
-
var element = document.querySelector(selector);
|
|
381
|
-
|
|
382
|
-
element.scrollIntoView();
|
|
383
|
-
element.parentNode.classList.add('selected');
|
|
384
|
-
} catch (error) {
|
|
385
|
-
console.error(error);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
function getFontSize() {
|
|
390
|
-
var currentFontSize = 16;
|
|
391
|
-
|
|
392
|
-
try {
|
|
393
|
-
currentFontSize = Number.parseInt(
|
|
394
|
-
html.style.fontSize.split('px')[0],
|
|
395
|
-
10
|
|
396
|
-
);
|
|
397
|
-
} catch (error) {
|
|
398
|
-
console.log(error);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
return currentFontSize;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function updateFontSize(fontSize) {
|
|
405
|
-
html.style.fontSize = fontSize + 'px';
|
|
406
|
-
localStorage.setItem(fontSizeLocalStorageKey, fontSize);
|
|
407
|
-
var fontSizeText = document.querySelector(
|
|
408
|
-
'#b77a68a492f343baabea06fad81f651e'
|
|
409
|
-
);
|
|
410
|
-
|
|
411
|
-
if (fontSizeText) {
|
|
412
|
-
fontSizeText.innerHTML = fontSize;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
(function () {
|
|
417
|
-
var fontSize = getFontSize();
|
|
418
|
-
var fontSizeInLocalStorage = localStorage.getItem(fontSizeLocalStorageKey);
|
|
419
|
-
|
|
420
|
-
if (fontSizeInLocalStorage) {
|
|
421
|
-
var n = Number.parseInt(fontSizeInLocalStorage, 10);
|
|
422
|
-
|
|
423
|
-
if (n === fontSize) {
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
426
|
-
updateFontSize(n);
|
|
427
|
-
} else {
|
|
428
|
-
updateFontSize(fontSize);
|
|
429
|
-
}
|
|
430
|
-
})();
|
|
431
|
-
|
|
432
|
-
// eslint-disable-next-line no-unused-vars
|
|
433
|
-
function incrementFont(event) {
|
|
434
|
-
var n = getFontSize();
|
|
435
|
-
|
|
436
|
-
if (n < MAX_FONT_SIZE) {
|
|
437
|
-
updateFontSize(n + 1);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
// eslint-disable-next-line no-unused-vars
|
|
442
|
-
function decrementFont(event) {
|
|
443
|
-
var n = getFontSize();
|
|
444
|
-
|
|
445
|
-
if (n > MIN_FONT_SIZE) {
|
|
446
|
-
updateFontSize(n - 1);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
function fontSizeTooltip() {
|
|
451
|
-
var fontSize = getFontSize();
|
|
452
|
-
|
|
453
|
-
return `
|
|
454
|
-
<div class="font-size-tooltip">
|
|
455
|
-
<button aria-label="decrease-font-size" class="icon-button ${fontSize >= MAX_FONT_SIZE ? 'disabled' : ''
|
|
456
|
-
}" onclick="decrementFont(event)">
|
|
457
|
-
<svg>
|
|
458
|
-
<use xlink:href="#minus-icon"></use>
|
|
459
|
-
</svg>
|
|
460
|
-
</button>
|
|
461
|
-
<div class="font-size-text" id="b77a68a492f343baabea06fad81f651e">
|
|
462
|
-
${fontSize}
|
|
463
|
-
</div>
|
|
464
|
-
<button aria-label="increase-font-size" class="icon-button ${fontSize <= MIN_FONT_SIZE ? 'disabled' : ''
|
|
465
|
-
}" onclick="incrementFont(event)">
|
|
466
|
-
<svg>
|
|
467
|
-
<use xlink:href="#add-icon"></use>
|
|
468
|
-
</svg>
|
|
469
|
-
</button>
|
|
470
|
-
<button class="icon-button" onclick="updateFontSize(16)">
|
|
471
|
-
<svg>
|
|
472
|
-
<use xlink:href="#reset-icon"></use>
|
|
473
|
-
</svg>
|
|
474
|
-
</button>
|
|
475
|
-
</div>
|
|
476
|
-
|
|
477
|
-
`;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
function initTooltip() {
|
|
481
|
-
// add tooltip to navbar item
|
|
482
|
-
// eslint-disable-next-line no-undef
|
|
483
|
-
tippy('.theme-toggle', {
|
|
484
|
-
content: 'Toggle Theme',
|
|
485
|
-
delay: 500
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
// eslint-disable-next-line no-undef
|
|
489
|
-
tippy('.search-button', {
|
|
490
|
-
content: 'Search',
|
|
491
|
-
delay: 500
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
// eslint-disable-next-line no-undef
|
|
495
|
-
tippy('.font-size', {
|
|
496
|
-
content: 'Change font size',
|
|
497
|
-
delay: 500
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
// eslint-disable-next-line no-undef
|
|
501
|
-
tippy('.codepen-button', {
|
|
502
|
-
content: 'Open code in CodePen',
|
|
503
|
-
placement: 'left'
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
// eslint-disable-next-line no-undef
|
|
507
|
-
tippy('.copy-code', {
|
|
508
|
-
content: 'Copy this code',
|
|
509
|
-
placement: 'left'
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
// eslint-disable-next-line no-undef
|
|
513
|
-
tippy('.font-size', {
|
|
514
|
-
content: fontSizeTooltip(),
|
|
515
|
-
trigger: 'click',
|
|
516
|
-
interactive: true,
|
|
517
|
-
allowHTML: true,
|
|
518
|
-
placement: 'left'
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
function fixTable() {
|
|
523
|
-
const tables = document.querySelectorAll('table');
|
|
524
|
-
|
|
525
|
-
for (const table of tables) {
|
|
526
|
-
if (table.classList.contains('hljs-ln')) {
|
|
527
|
-
// don't want to wrap code blocks.
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
var div = document.createElement('div');
|
|
532
|
-
|
|
533
|
-
div.classList.add('table-div');
|
|
534
|
-
table.parentNode.insertBefore(div, table);
|
|
535
|
-
div.appendChild(table);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
function hideMobileMenu() {
|
|
540
|
-
var mobileMenuContainer = document.querySelector('#mobile-sidebar');
|
|
541
|
-
var target = document.querySelector('#mobile-menu');
|
|
542
|
-
var svgUse = target.querySelector('use');
|
|
543
|
-
|
|
544
|
-
if (mobileMenuContainer) {
|
|
545
|
-
mobileMenuContainer.classList.remove('show');
|
|
546
|
-
}
|
|
547
|
-
if (target) {
|
|
548
|
-
target.setAttribute('data-isopen', 'false');
|
|
549
|
-
}
|
|
550
|
-
if (svgUse) {
|
|
551
|
-
svgUse.setAttribute('xlink:href', '#menu-icon');
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
function showMobileMenu() {
|
|
556
|
-
var mobileMenuContainer = document.querySelector('#mobile-sidebar');
|
|
557
|
-
var target = document.querySelector('#mobile-menu');
|
|
558
|
-
var svgUse = target.querySelector('use');
|
|
559
|
-
|
|
560
|
-
if (mobileMenuContainer) {
|
|
561
|
-
mobileMenuContainer.classList.add('show');
|
|
562
|
-
}
|
|
563
|
-
if (target) {
|
|
564
|
-
target.setAttribute('data-isopen', 'true');
|
|
565
|
-
}
|
|
566
|
-
if (svgUse) {
|
|
567
|
-
svgUse.setAttribute('xlink:href', '#close-icon');
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
function onMobileMenuClick() {
|
|
572
|
-
var target = document.querySelector('#mobile-menu');
|
|
573
|
-
var isOpen = target.getAttribute('data-isopen') === 'true';
|
|
574
|
-
|
|
575
|
-
if (isOpen) {
|
|
576
|
-
hideMobileMenu();
|
|
577
|
-
} else {
|
|
578
|
-
showMobileMenu();
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
function initMobileMenu() {
|
|
583
|
-
var menu = document.querySelector('#mobile-menu');
|
|
584
|
-
|
|
585
|
-
if (menu) {
|
|
586
|
-
menu.addEventListener('click', onMobileMenuClick);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
function addHrefToSidebarTitle() {
|
|
591
|
-
var titles = document.querySelectorAll('.sidebar-title-anchor');
|
|
592
|
-
|
|
593
|
-
titles.forEach(function (title) {
|
|
594
|
-
// eslint-disable-next-line no-undef
|
|
595
|
-
title.setAttribute('href', baseURL);
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
function initClassTreeWidth() {
|
|
600
|
-
var width = 0;
|
|
601
|
-
var items = document.querySelectorAll('.class-tree');
|
|
602
|
-
|
|
603
|
-
items.forEach(function (item) {
|
|
604
|
-
if(item.querySelector('td .desc').textContent){
|
|
605
|
-
width = Math.max(item.querySelector('th .title').offsetWidth, width);
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
var titles = document.querySelectorAll('.class-tree th');
|
|
611
|
-
|
|
612
|
-
titles.forEach(function (title) {
|
|
613
|
-
title.style.width = width + 'px';
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
function initTabs() {
|
|
618
|
-
const tabs = document.querySelectorAll('.nav-tabs .nav-tab');
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
tabs.forEach(function (tab) {
|
|
622
|
-
tab.addEventListener('click', function(event) {
|
|
623
|
-
event.preventDefault();
|
|
624
|
-
if(!tab.classList.contains('active')) {
|
|
625
|
-
for (const elem of tab.parentNode.parentNode.querySelectorAll('.nav-tab'))
|
|
626
|
-
{
|
|
627
|
-
elem.classList.remove('active');
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
tab.classList.add('active');
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
let content = document.getElementById(tab.getAttribute('href').slice(1));
|
|
634
|
-
|
|
635
|
-
if(content){
|
|
636
|
-
|
|
637
|
-
for (const elem of content.parentNode.children)
|
|
638
|
-
{
|
|
639
|
-
elem.classList.remove('active');
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
if(!content.classList.contains('active')) {
|
|
643
|
-
content.classList.add('active');
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
});
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
function onDomContentLoaded() {
|
|
652
|
-
var themeButton = document.querySelectorAll('.theme-toggle');
|
|
653
|
-
|
|
654
|
-
initMobileMenu();
|
|
655
|
-
initClassTreeWidth();
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
if (themeButton) {
|
|
659
|
-
themeButton.forEach(function (button) {
|
|
660
|
-
button.addEventListener('click', toggleTheme);
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
// Highlighting code
|
|
665
|
-
|
|
666
|
-
// eslint-disable-next-line no-undef
|
|
667
|
-
//hljs.addPlugin({
|
|
668
|
-
// 'after:highlightElement': function (obj) {
|
|
669
|
-
// // Replace 'code' with result.language when
|
|
670
|
-
// // we are able to cross-check the correctness of
|
|
671
|
-
// // result.
|
|
672
|
-
// //obj.el.parentNode.setAttribute('data-lang', 'code');
|
|
673
|
-
// }
|
|
674
|
-
//});
|
|
675
|
-
|
|
676
|
-
// eslint-disable-next-line no-undef
|
|
677
|
-
hljs.highlightAll();
|
|
678
|
-
// eslint-disable-next-line no-undef
|
|
679
|
-
hljs.initLineNumbersOnLoad({
|
|
680
|
-
singleLine: true
|
|
681
|
-
});
|
|
682
|
-
|
|
683
|
-
// Highlight complete
|
|
684
|
-
initTabs();
|
|
685
|
-
initAccordion();
|
|
686
|
-
addAnchor();
|
|
687
|
-
processAllPre();
|
|
688
|
-
hideTocOnSourcePage();
|
|
689
|
-
setTimeout(function () {
|
|
690
|
-
bringIdToViewOnMount();
|
|
691
|
-
if (isSourcePage()) {
|
|
692
|
-
highlightAndBringLineIntoView();
|
|
693
|
-
}
|
|
694
|
-
}, 1000);
|
|
695
|
-
initTooltip();
|
|
696
|
-
fixTable();
|
|
697
|
-
addHrefToSidebarTitle();
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// eslint-disable-next-line no-undef
|
|
701
|
-
window.addEventListener('DOMContentLoaded', onDomContentLoaded);
|
|
702
|
-
|
|
703
|
-
// eslint-disable-next-line no-undef
|
|
704
|
-
window.addEventListener('hashchange', (event) => {
|
|
705
|
-
const url = new URL(event.newURL);
|
|
706
|
-
|
|
707
|
-
if (url.hash !== '') {
|
|
708
|
-
bringIdToViewOnMount(url.hash);
|
|
709
|
-
}
|
|
710
|
-
});
|