@rxap/layout 18.0.2 → 18.0.3-dev.0
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/compodoc/changelog.html +730 -0
- package/compodoc/components/AppsButtonComponent.html +604 -0
- package/compodoc/components/FooterComponent.html +487 -0
- package/compodoc/components/HeaderComponent.html +781 -0
- package/compodoc/components/LanguageSelectorComponent.html +526 -0
- package/compodoc/components/LayoutComponent.html +1035 -0
- package/compodoc/components/NavigationComponent.html +1156 -0
- package/compodoc/components/NavigationItemComponent.html +1328 -0
- package/compodoc/components/NavigationProgressBarComponent.html +550 -0
- package/compodoc/components/ResetButtonComponent.html +486 -0
- package/compodoc/components/SettingsButtonComponent.html +1416 -0
- package/compodoc/components/SidenavComponent.html +689 -0
- package/compodoc/components/SidenavToggleButtonComponent.html +517 -0
- package/compodoc/components/SignOutComponent.html +493 -0
- package/compodoc/components/ToggleWindowSidenavButtonComponent.html +549 -0
- package/compodoc/components/UserProfileIconComponent.html +657 -0
- package/compodoc/components/VersionComponent.html +524 -0
- package/compodoc/components/WindowContainerSidenavComponent.html +687 -0
- package/compodoc/dependencies.html +239 -0
- package/compodoc/directives/FooterDirective.html +371 -0
- package/compodoc/directives/SidenavFooterDirective.html +387 -0
- package/compodoc/directives/SidenavHeaderDirective.html +387 -0
- package/compodoc/fonts/ionicons.eot +0 -0
- package/compodoc/fonts/ionicons.svg +2090 -0
- package/compodoc/fonts/ionicons.ttf +0 -0
- package/compodoc/fonts/ionicons.woff +0 -0
- package/compodoc/fonts/ionicons.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.svg +314 -0
- package/compodoc/fonts/roboto-v15-latin-300.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.svg +310 -0
- package/compodoc/fonts/roboto-v15-latin-700.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.svg +323 -0
- package/compodoc/fonts/roboto-v15-latin-italic.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.svg +308 -0
- package/compodoc/fonts/roboto-v15-latin-regular.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.woff2 +0 -0
- package/compodoc/graph/dependencies.svg +24 -0
- package/compodoc/images/compodoc-vectorise-inverted.png +0 -0
- package/compodoc/images/compodoc-vectorise-inverted.svg +201 -0
- package/compodoc/images/compodoc-vectorise.png +0 -0
- package/compodoc/images/compodoc-vectorise.svg +201 -0
- package/compodoc/images/favicon.ico +0 -0
- package/compodoc/index.html +190 -0
- package/compodoc/injectables/AppUrlService.html +829 -0
- package/compodoc/injectables/AuthenticationServiceMock.html +303 -0
- package/compodoc/injectables/LayoutComponentService.html +848 -0
- package/compodoc/injectables/NavigationService.html +1081 -0
- package/compodoc/injectables/ReplaceRouterPathsService.html +337 -0
- package/compodoc/injectables/SidenavComponentService.html +408 -0
- package/compodoc/interfaces/ExternalApps.html +634 -0
- package/compodoc/interfaces/LogoConfig.html +381 -0
- package/compodoc/interfaces/NavigationDividerItem.html +385 -0
- package/compodoc/interfaces/NavigationInsertItem.html +340 -0
- package/compodoc/interfaces/NavigationItem.html +520 -0
- package/compodoc/interfaces/NavigationStatus.html +376 -0
- package/compodoc/js/compodoc.js +14 -0
- package/compodoc/js/lazy-load-graphs.js +44 -0
- package/compodoc/js/libs/EventDispatcher.js +5 -0
- package/compodoc/js/libs/bootstrap-native.js +2 -0
- package/compodoc/js/libs/clipboard.min.js +7 -0
- package/compodoc/js/libs/custom-elements-es5-adapter.js +15 -0
- package/compodoc/js/libs/custom-elements.min.js +38 -0
- package/compodoc/js/libs/d3.v3.min.js +2 -0
- package/compodoc/js/libs/deep-iterator.js +2 -0
- package/compodoc/js/libs/es6-shim.min.js +12 -0
- package/compodoc/js/libs/htmlparser.js +23 -0
- package/compodoc/js/libs/innersvg.js +9 -0
- package/compodoc/js/libs/lit-html.js +1 -0
- package/compodoc/js/libs/prism.js +46 -0
- package/compodoc/js/libs/promise.min.js +6 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -0
- package/compodoc/js/libs/tablesort.min.js +6 -0
- package/compodoc/js/libs/tablesort.number.min.js +6 -0
- package/compodoc/js/libs/vis.min.js +47 -0
- package/compodoc/js/libs/zepto.min.js +2 -0
- package/compodoc/js/menu-wc.js +237 -0
- package/compodoc/js/menu-wc_es5.js +40 -0
- package/compodoc/js/menu.js +270 -0
- package/compodoc/js/routes.js +301 -0
- package/compodoc/js/search/lunr.min.js +6 -0
- package/compodoc/js/search/search-lunr.js +67 -0
- package/compodoc/js/search/search.js +283 -0
- package/compodoc/js/search/search_index.js +4 -0
- package/compodoc/js/sourceCode.js +58 -0
- package/compodoc/js/svg-pan-zoom.controls.js +53 -0
- package/compodoc/js/tabs.js +21 -0
- package/compodoc/js/tree.js +147 -0
- package/compodoc/license.html +731 -0
- package/compodoc/miscellaneous/functions.html +389 -0
- package/compodoc/miscellaneous/typealiases.html +256 -0
- package/compodoc/miscellaneous/variables.html +370 -0
- package/compodoc/modules.html +183 -0
- package/compodoc/overview.html +225 -0
- package/compodoc/pipes/ReplaceRouterPathsPipe.html +363 -0
- package/compodoc/properties.html +195 -0
- package/compodoc/styles/bootstrap-card.css +219 -0
- package/compodoc/styles/bootstrap.min.css +6 -0
- package/compodoc/styles/compodoc.css +1124 -0
- package/compodoc/styles/dark.css +121 -0
- package/compodoc/styles/ionicons.min.css +11 -0
- package/compodoc/styles/laravel.css +113 -0
- package/compodoc/styles/material.css +131 -0
- package/compodoc/styles/original.css +51 -0
- package/compodoc/styles/postmark.css +238 -0
- package/compodoc/styles/prism.css +301 -0
- package/compodoc/styles/readthedocs.css +117 -0
- package/compodoc/styles/reset.css +129 -0
- package/compodoc/styles/stripe.css +106 -0
- package/compodoc/styles/style.css +7 -0
- package/compodoc/styles/tablesort.css +33 -0
- package/compodoc/styles/vagrant.css +130 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +43 -0
- package/docs/assets/icons.js +15 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1412 -0
- package/docs/classes/AppUrlService.html +13 -0
- package/docs/classes/AppsButtonComponent.html +9 -0
- package/docs/classes/AuthenticationServiceMock.html +3 -0
- package/docs/classes/FooterComponent.html +3 -0
- package/docs/classes/FooterDirective.html +8 -0
- package/docs/classes/HeaderComponent.html +8 -0
- package/docs/classes/LanguageSelectorComponent.html +3 -0
- package/docs/classes/LayoutComponent.html +18 -0
- package/docs/classes/LayoutComponentService.html +15 -0
- package/docs/classes/NavigationComponent.html +15 -0
- package/docs/classes/NavigationItemComponent.html +22 -0
- package/docs/classes/NavigationProgressBarComponent.html +4 -0
- package/docs/classes/NavigationService.html +17 -0
- package/docs/classes/ReplaceRouterPathsPipe.html +4 -0
- package/docs/classes/ReplaceRouterPathsService.html +3 -0
- package/docs/classes/ResetButtonComponent.html +3 -0
- package/docs/classes/SettingsButtonComponent.html +30 -0
- package/docs/classes/SidenavComponent.html +5 -0
- package/docs/classes/SidenavComponentService.html +5 -0
- package/docs/classes/SidenavFooterDirective.html +3 -0
- package/docs/classes/SidenavHeaderDirective.html +3 -0
- package/docs/classes/SidenavToggleButtonComponent.html +4 -0
- package/docs/classes/SignOutComponent.html +4 -0
- package/docs/classes/ToggleWindowSidenavButtonComponent.html +5 -0
- package/docs/classes/UserProfileIconComponent.html +6 -0
- package/docs/classes/VersionComponent.html +7 -0
- package/docs/classes/WindowContainerSidenavComponent.html +10 -0
- package/docs/documentation.json +13292 -0
- package/docs/functions/IsNavigationDividerItem.html +1 -0
- package/docs/functions/IsNavigationInsertItem.html +1 -0
- package/docs/functions/IsNavigationItem.html +1 -0
- package/docs/index.html +16 -0
- package/docs/interfaces/ExternalApps.html +8 -0
- package/docs/interfaces/LogoConfig.html +4 -0
- package/docs/interfaces/NavigationDividerItem.html +3 -0
- package/docs/interfaces/NavigationInsertItem.html +2 -0
- package/docs/interfaces/NavigationItem.html +6 -0
- package/docs/interfaces/NavigationStatus.html +2 -0
- package/docs/modules.html +47 -0
- package/docs/types/ExtractUsernameFromProfileFn.html +1 -0
- package/docs/types/Navigation.html +1 -0
- package/docs/types/NavigationWithInserts.html +1 -0
- package/docs/variables/EXTRACT_USERNAME_FROM_PROFILE.html +1 -0
- package/docs/variables/RXAP_FOOTER_COMPONENT.html +1 -0
- package/docs/variables/RXAP_HEADER_COMPONENT.html +1 -0
- package/docs/variables/RXAP_LAYOUT_APPS_GRID.html +1 -0
- package/docs/variables/RXAP_LOGO_CONFIG.html +1 -0
- package/docs/variables/RXAP_NAVIGATION_CONFIG.html +1 -0
- package/docs/variables/RXAP_NAVIGATION_CONFIG_INSERTS.html +1 -0
- package/package.json +44 -44
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
(function(compodoc) {
|
|
2
|
+
|
|
3
|
+
function LunrSearchEngine() {
|
|
4
|
+
this.index = undefined;
|
|
5
|
+
this.store = {};
|
|
6
|
+
this.name = 'LunrSearchEngine';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
LunrSearchEngine.prototype.init = function() {
|
|
10
|
+
var that = this,
|
|
11
|
+
d = new promise.Promise();
|
|
12
|
+
|
|
13
|
+
that.index = lunr.Index.load(COMPODOC_SEARCH_INDEX.index);
|
|
14
|
+
that.store = COMPODOC_SEARCH_INDEX.store;
|
|
15
|
+
d.done();
|
|
16
|
+
|
|
17
|
+
return d;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
LunrSearchEngine.prototype.search = function(q, offset, length) {
|
|
21
|
+
var that = this,
|
|
22
|
+
results = [],
|
|
23
|
+
d = new promise.Promise();
|
|
24
|
+
|
|
25
|
+
if (this.index) {
|
|
26
|
+
results = $.map(this.index.search('*' + q + '*'), function(result) {
|
|
27
|
+
var doc = that.store[result.ref];
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
title: doc.title,
|
|
31
|
+
url: doc.url,
|
|
32
|
+
body: doc.summary || doc.body
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
d.done({
|
|
38
|
+
query: q,
|
|
39
|
+
results: length === 0 ? results : results.slice(0, length),
|
|
40
|
+
count: results.length
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return d;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
compodoc.addEventListener(compodoc.EVENTS.READY, function(event) {
|
|
47
|
+
var engine = new LunrSearchEngine(),
|
|
48
|
+
initialized = false;
|
|
49
|
+
|
|
50
|
+
function query(q, offset, length) {
|
|
51
|
+
if (!initialized) throw new Error('Search has not been initialized');
|
|
52
|
+
return engine.search(q, offset, length);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
compodoc.search = {
|
|
56
|
+
query: query
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
engine.init()
|
|
60
|
+
.then(function() {
|
|
61
|
+
initialized = true;
|
|
62
|
+
compodoc.dispatchEvent({
|
|
63
|
+
type: compodoc.EVENTS.SEARCH_READY
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
})(compodoc);
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
(function (compodoc) {
|
|
2
|
+
var usePushState = typeof history.pushState !== 'undefined',
|
|
3
|
+
// DOM Elements
|
|
4
|
+
$body = $('body'),
|
|
5
|
+
$searchResults,
|
|
6
|
+
$searchInput,
|
|
7
|
+
$searchList,
|
|
8
|
+
$searchTitle,
|
|
9
|
+
$searchResultsCount,
|
|
10
|
+
$searchQuery,
|
|
11
|
+
$mainContainer,
|
|
12
|
+
$xsMenu;
|
|
13
|
+
|
|
14
|
+
// Throttle search
|
|
15
|
+
function throttle(fn, wait) {
|
|
16
|
+
var timeout;
|
|
17
|
+
|
|
18
|
+
return function () {
|
|
19
|
+
var ctx = this,
|
|
20
|
+
args = arguments;
|
|
21
|
+
if (!timeout) {
|
|
22
|
+
timeout = setTimeout(function () {
|
|
23
|
+
timeout = undefined;
|
|
24
|
+
fn.apply(ctx, args);
|
|
25
|
+
}, wait);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function displayResults(res) {
|
|
31
|
+
var noResults = res.count == 0;
|
|
32
|
+
var groups = {};
|
|
33
|
+
$searchResults.toggleClass('no-results', noResults);
|
|
34
|
+
|
|
35
|
+
// Clear old results
|
|
36
|
+
$searchList.empty();
|
|
37
|
+
|
|
38
|
+
// Display title for research
|
|
39
|
+
$searchResultsCount.text(res.count);
|
|
40
|
+
$searchQuery.text(res.query);
|
|
41
|
+
|
|
42
|
+
// Group result by context
|
|
43
|
+
res.results.forEach(function (res) {
|
|
44
|
+
var context = res.title.split(' - ')[0];
|
|
45
|
+
if (typeof groups[context] === 'undefined') {
|
|
46
|
+
groups[context] = {
|
|
47
|
+
results: [res]
|
|
48
|
+
};
|
|
49
|
+
} else {
|
|
50
|
+
groups[context].results.push(res);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
var sortedGroups = Object.keys(groups).sort();
|
|
55
|
+
|
|
56
|
+
for (var i = 0; i < sortedGroups.length; i++) {
|
|
57
|
+
var property = sortedGroups[i];
|
|
58
|
+
|
|
59
|
+
var $li = $('<li>', {
|
|
60
|
+
class: 'search-results-group'
|
|
61
|
+
});
|
|
62
|
+
var finalPropertyLabel = '';
|
|
63
|
+
var propertyLabels = property.split('-');
|
|
64
|
+
|
|
65
|
+
if (
|
|
66
|
+
propertyLabels.length === 2 &&
|
|
67
|
+
propertyLabels[0] !== 'miscellaneous' &&
|
|
68
|
+
propertyLabels[0] !== 'additional'
|
|
69
|
+
) {
|
|
70
|
+
finalPropertyLabel =
|
|
71
|
+
propertyLabels[0].charAt(0).toUpperCase() +
|
|
72
|
+
propertyLabels[0].substring(1) +
|
|
73
|
+
' - ' +
|
|
74
|
+
propertyLabels[1].charAt(0).toUpperCase() +
|
|
75
|
+
propertyLabels[1].substring(1) +
|
|
76
|
+
' (' +
|
|
77
|
+
groups[property].results.length +
|
|
78
|
+
')';
|
|
79
|
+
} else if (propertyLabels[0] === 'additional') {
|
|
80
|
+
finalPropertyLabel =
|
|
81
|
+
'Additional pages' + ' (' + groups[property].results.length + ')';
|
|
82
|
+
} else {
|
|
83
|
+
finalPropertyLabel =
|
|
84
|
+
propertyLabels[0].charAt(0).toUpperCase() +
|
|
85
|
+
propertyLabels[0].substring(1) +
|
|
86
|
+
' (' +
|
|
87
|
+
groups[property].results.length +
|
|
88
|
+
')';
|
|
89
|
+
}
|
|
90
|
+
var $groupTitle = $('<h3>', {
|
|
91
|
+
text: finalPropertyLabel
|
|
92
|
+
});
|
|
93
|
+
$groupTitle.appendTo($li);
|
|
94
|
+
|
|
95
|
+
var $ulResults = $('<ul>', {
|
|
96
|
+
class: 'search-results-list'
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
groups[property].results.forEach(function (res) {
|
|
100
|
+
var link = '';
|
|
101
|
+
var $liResult = $('<li>', {
|
|
102
|
+
class: 'search-results-item'
|
|
103
|
+
});
|
|
104
|
+
switch (COMPODOC_CURRENT_PAGE_DEPTH) {
|
|
105
|
+
case 0:
|
|
106
|
+
link = './';
|
|
107
|
+
break;
|
|
108
|
+
case 1:
|
|
109
|
+
case 2:
|
|
110
|
+
case 3:
|
|
111
|
+
case 4:
|
|
112
|
+
case 5:
|
|
113
|
+
link = '../'.repeat(COMPODOC_CURRENT_PAGE_DEPTH);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
var finalResLabel =
|
|
117
|
+
res.title.split(' - ')[1].charAt(0).toUpperCase() +
|
|
118
|
+
res.title.split(' - ')[1].substring(1);
|
|
119
|
+
var $link = $('<a>', {
|
|
120
|
+
href: link + res.url,
|
|
121
|
+
text: finalResLabel
|
|
122
|
+
});
|
|
123
|
+
$link.appendTo($liResult);
|
|
124
|
+
$liResult.appendTo($ulResults);
|
|
125
|
+
});
|
|
126
|
+
$ulResults.appendTo($li);
|
|
127
|
+
|
|
128
|
+
$li.appendTo($searchList);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function launchSearch(q) {
|
|
133
|
+
$body.addClass('with-search');
|
|
134
|
+
|
|
135
|
+
if ($xsMenu.css('display') === 'block') {
|
|
136
|
+
$mainContainer.css('height', 'calc(100% - 100px)');
|
|
137
|
+
$mainContainer.css('margin-top', '100px');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
throttle(
|
|
141
|
+
compodoc.search.query(q, 0, MAX_SEARCH_RESULTS).then(function (results) {
|
|
142
|
+
displayResults(results);
|
|
143
|
+
}),
|
|
144
|
+
1000
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function closeSearch() {
|
|
149
|
+
$body.removeClass('with-search');
|
|
150
|
+
if ($xsMenu.css('display') === 'block') {
|
|
151
|
+
$mainContainer.css('height', 'calc(100% - 50px)');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function bindMenuButton() {
|
|
156
|
+
document.getElementById('btn-menu').addEventListener('click', function () {
|
|
157
|
+
if ($xsMenu.css('display') === 'none') {
|
|
158
|
+
$body.removeClass('with-search');
|
|
159
|
+
$mainContainer.css('height', 'calc(100% - 50px)');
|
|
160
|
+
}
|
|
161
|
+
$.each($searchInputs, function (index, item) {
|
|
162
|
+
var item = $(item);
|
|
163
|
+
item.val('');
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function bindSearch() {
|
|
169
|
+
// Bind DOM
|
|
170
|
+
$searchInputs = $('#book-search-input input');
|
|
171
|
+
|
|
172
|
+
$searchResults = $('.search-results');
|
|
173
|
+
$searchList = $searchResults.find('.search-results-list');
|
|
174
|
+
$searchTitle = $searchResults.find('.search-results-title');
|
|
175
|
+
$searchResultsCount = $searchTitle.find('.search-results-count');
|
|
176
|
+
$searchQuery = $searchTitle.find('.search-query');
|
|
177
|
+
$mainContainer = $('.container-fluid');
|
|
178
|
+
$xsMenu = $('.xs-menu');
|
|
179
|
+
|
|
180
|
+
// Launch query based on input content
|
|
181
|
+
function handleUpdate(item) {
|
|
182
|
+
var q = item.val();
|
|
183
|
+
|
|
184
|
+
if (q.length == 0) {
|
|
185
|
+
closeSearch();
|
|
186
|
+
window.location.href = window.location.href.replace(window.location.search, '');
|
|
187
|
+
} else {
|
|
188
|
+
launchSearch(q);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Detect true content change in search input
|
|
193
|
+
var propertyChangeUnbound = false;
|
|
194
|
+
|
|
195
|
+
$.each($searchInputs, function (index, item) {
|
|
196
|
+
var item = $(item);
|
|
197
|
+
// HTML5 (IE9 & others)
|
|
198
|
+
item.on('input', function (e) {
|
|
199
|
+
// Unbind propertychange event for IE9+
|
|
200
|
+
if (!propertyChangeUnbound) {
|
|
201
|
+
$(this).unbind('propertychange');
|
|
202
|
+
propertyChangeUnbound = true;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
handleUpdate($(this));
|
|
206
|
+
});
|
|
207
|
+
// Workaround for IE < 9
|
|
208
|
+
item.on('propertychange', function (e) {
|
|
209
|
+
if (e.originalEvent.propertyName == 'value') {
|
|
210
|
+
handleUpdate($(this));
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
// Push to history on blur
|
|
214
|
+
item.on('blur', function (e) {
|
|
215
|
+
// Update history state
|
|
216
|
+
if (usePushState) {
|
|
217
|
+
var uri = updateQueryString('q', $(this).val());
|
|
218
|
+
if ($(this).val() !== '') {
|
|
219
|
+
history.pushState({ path: uri }, null, uri);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function launchSearchFromQueryString() {
|
|
227
|
+
var q = getParameterByName('q');
|
|
228
|
+
if (q && q.length > 0) {
|
|
229
|
+
// Update search inputs
|
|
230
|
+
$.each($searchInputs, function (index, item) {
|
|
231
|
+
var item = $(item);
|
|
232
|
+
item.val(q);
|
|
233
|
+
});
|
|
234
|
+
// Launch search
|
|
235
|
+
launchSearch(q);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
compodoc.addEventListener(compodoc.EVENTS.SEARCH_READY, function (event) {
|
|
240
|
+
bindSearch();
|
|
241
|
+
|
|
242
|
+
bindMenuButton();
|
|
243
|
+
|
|
244
|
+
launchSearchFromQueryString();
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
function getParameterByName(name) {
|
|
248
|
+
var url = window.location.href;
|
|
249
|
+
name = name.replace(/[\[\]]/g, '\\$&');
|
|
250
|
+
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'),
|
|
251
|
+
results = regex.exec(url);
|
|
252
|
+
if (!results) return null;
|
|
253
|
+
if (!results[2]) return '';
|
|
254
|
+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function updateQueryString(key, value) {
|
|
258
|
+
value = encodeURIComponent(value);
|
|
259
|
+
|
|
260
|
+
var url = window.location.href;
|
|
261
|
+
var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'),
|
|
262
|
+
hash;
|
|
263
|
+
|
|
264
|
+
if (re.test(url)) {
|
|
265
|
+
if (typeof value !== 'undefined' && value !== null)
|
|
266
|
+
return url.replace(re, '$1' + key + '=' + value + '$2$3');
|
|
267
|
+
else {
|
|
268
|
+
hash = url.split('#');
|
|
269
|
+
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
|
|
270
|
+
if (typeof hash[1] !== 'undefined' && hash[1] !== null) url += '#' + hash[1];
|
|
271
|
+
return url;
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
if (typeof value !== 'undefined' && value !== null) {
|
|
275
|
+
var separator = url.indexOf('?') !== -1 ? '&' : '?';
|
|
276
|
+
hash = url.split('#');
|
|
277
|
+
url = hash[0] + separator + key + '=' + value;
|
|
278
|
+
if (typeof hash[1] !== 'undefined' && hash[1] !== null) url += '#' + hash[1];
|
|
279
|
+
return url;
|
|
280
|
+
} else return url;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
})(compodoc);
|