├── .github
└── workflows
│ └── publish-kb.yml
├── .gitignore
├── .vscode
└── settings.json
├── CODEOWNERS
├── LICENSE
├── README.md
├── _assetsApi
├── api
│ └── index.md
├── docfx-tmpl
│ └── src
│ │ ├── partials
│ │ ├── docsearch.tmpl.partial
│ │ └── footer.tmpl.partial
│ │ └── styles
│ │ ├── docfx.js
│ │ └── main.css
└── filterConfig.yml
├── _config.yml
├── basic-usage
├── capture-https-traffic.md
├── configuration.md
├── import-export-sessions.md
├── register-as-system-proxy.md
├── session-flags.md
└── use-custom-root-certificate.md
├── exclude.txt
├── favicon.ico
├── getting-started
├── download-product-files.md
├── first-steps.md
├── images
│ ├── binaries-current-structure.png
│ ├── binaries-references.png
│ ├── binaries-structure.png
│ ├── calendar-getting-started-update-packages.png
│ ├── download_product_files_1.png
│ ├── download_product_files_2.png
│ ├── download_product_files_3.png
│ ├── downloads
│ │ ├── account-downloads-002.png
│ │ ├── account-downloads-003.png
│ │ └── account-downloads-005.png
│ ├── getting-started-add-package-source.png
│ ├── getting-started-add-packages-dialog.png
│ ├── getting-started-add-packages-menu.png
│ ├── getting-started-add-telerk-server.png
│ ├── getting-started-configure-sources.png
│ ├── getting-started-restore-packages.png
│ ├── item-templates-stocks-view-android-5.7inch.png
│ ├── legacy-binaries-references.png
│ ├── legacy-binaries-structure.png
│ ├── logo.png
│ ├── nuget-keys-telerik-001.png
│ ├── nuget-server
│ │ ├── nuget-vs-add-packages.png
│ │ ├── nuget-vs-add-source.png
│ │ ├── nuget-vs-manage-packages.png
│ │ ├── nuget-vs-pm-settings.png
│ │ └── nuget-vs-telerik-server.png
│ ├── registry-key.png
│ ├── telerik-account-zip-download.png
│ ├── telerik-ui-for-xamarin.png
│ ├── telrik-project-wizard.png
│ ├── visual-studio-created-solution.png
│ ├── visual-studio-new-project-create.png
│ ├── visual-studio-new-project-dialog.png
│ ├── visual-studio-new-solution.png
│ ├── visual-studio-new-solution_screen2.png
│ ├── visual-studio-project-wizard.png
│ ├── visual-studio-solution-projects.png
│ ├── vs2015_xamarin_install.png
│ ├── vs2017_xamarin_workload.png
│ ├── vsmac_xamarin.png
│ └── xamarin-studio-new-solution.png
├── nuget-sso.md
├── system-requirements.md
└── telerik-nuget-server.md
├── images
├── anchor.png
├── api.png
├── arrow.png
├── caution-icon.png
├── close-btn.svg
├── close.png
├── column.png
├── datagrid_localization.png
├── datagrid_resourcemanager.png
├── datagrid_resourcesfile.png
├── external.png
├── file-white.png
├── file.png
├── folder-close.png
├── folder-open.png
├── getting-started.png
├── howdoi.png
├── icon-telerik-badge.png
├── important-icon.png
├── important.png
├── logo.png
├── menu.png
├── minus.png
├── nav-arrow.png
├── note-icon.png
├── note-types
│ ├── notetypes-actualappearance.png
│ └── notetypes-mddeclaration.PNG
├── open.png
├── plus.png
├── search-24.png
├── search.png
├── tap-logo.png
├── tip-icon.png
└── tutorials.png
├── introduction.md
├── knowledge-base
├── modifying-response-with-fiddler-core.md
└── persisting-the-root-certificate-in-fiddler-core.md
├── licensing
├── copyright.md
├── license-agreement.md
└── personal-data-collection.md
├── release-history.md
├── to_delete.md
└── web.config
/.github/workflows/publish-kb.yml:
--------------------------------------------------------------------------------
1 | name: Publish Knowledge Base Article
2 | on:
3 | repository_dispatch:
4 | types: [publish-kb]
5 |
6 | run-name: Publish Knowledge Base Article ${{ github.event.client_payload.name }} ${{ github.event.client_payload.id }}
7 |
8 | permissions:
9 | contents: write
10 | pull-requests: write
11 |
12 | concurrency:
13 | group: '${{ github.workflow }} ${{ github.event.client_payload.id }}'
14 | cancel-in-progress: true
15 |
16 | jobs:
17 | publish_kb:
18 | runs-on: ubuntu-latest
19 | steps:
20 | - name: configure git
21 | run: |
22 | git config --global user.email "kb-bot@telerik.com"
23 | git config --global user.name "KB Bot"
24 |
25 | - name: Checkout
26 | uses: actions/checkout@v3
27 |
28 | - name: Create branch
29 | run: |
30 | git checkout -b "new-kb-$name-$id"
31 | cd $folder
32 | echo "$content" > "$name.md"
33 | git add "$name.md"
34 | git commit -m "Added new kb article $name"
35 | git push -u origin "new-kb-$name-$id"
36 | env:
37 | name: ${{ github.event.client_payload.name }}
38 | content: ${{ github.event.client_payload.content }}
39 | folder: ${{ github.event.client_payload.folder }}
40 | id: ${{ github.event.client_payload.id }}
41 |
42 | - name: Create pull request
43 | run: gh pr create --fill
44 | env:
45 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 |
47 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .bundle
3 | .dockerignore
4 | .editorconfig
5 | .jekyll-metadata
6 | .ruby-version
7 | .suo
8 | .vs
9 | /.asset-cache/
10 | /LICENSE
11 | /_assets/
12 | /_build/
13 | /_buildApi/
14 | /_common/root/
15 | /_data/
16 | /_includes/
17 | /_layouts/
18 | /_plugins/
19 | /_site/
20 | /_templates/
21 | /_tools/
22 | /docs-watcher/
23 | /favicon.ico
24 | /fonts/
25 | /styles/
26 | Dockerfile
27 | Gemfile
28 | Gemfile.lock
29 | _site_SL
30 | _tempconfig.yml
31 | bs-config.js
32 | build-docs.sh
33 | copy_content.sh
34 | copy_local.sh
35 | install-npm.sh
36 | knowledge-base.html
37 | modify-config.sh
38 | robots.txt
39 | search.html
40 | start-docs-sl.sh
41 | start-docs.sh
42 | watch.sh
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cSpell.words": [
3 | "Prefs",
4 | "Strahl's",
5 | "certmaker",
6 | "fiddlercore",
7 | "strahl",
8 | "ticketid"
9 | ]
10 | }
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @telerik/docs-seed-reviewers
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright (c) 2015-2019 Progress Software Corporation
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | FiddlerCore Public Documentation
3 |
4 |
Welcome to the GitHub repo for FiddlerCoreDocumentation. This repository contains the source content--written in Markdown--that we use to power the FiddlerCore documentation.
5 |
6 |
We believe that the documentation for a product is at its best when the content is a collaboration between the builders and consumers of that product. As such, this documentation is both public, and open sourced. That means you can clone this repository, read the docs off line, or even load the entire thing to an Apple Newton, if that's your thing.
7 |
8 |
It also means that you can play a role in making our docs better for everyone, and if helping us make the FiddlerCore docs better sounds interesting to you, read on.
9 |
10 |
11 | Contributing
12 |
13 |
There are two ways you can contribute to the public FiddlerCore documentation: either create an issue in this repository, or fork the repo, make the change and send us a pull request!
14 |
15 |
16 |
17 |
Create an issue - If you find an issue with our docs that needs to be addressed, the best way to let us know about it is by creating an issue in this repository. When creating an issue, provide a descriptive title, be as specific as possible and link to the document in question (If you can provide a link to the closest anchor to the issue, all the better). Here's an example:
18 |
19 |
Title: foo/bar/setting-things-up.md is missing an image
20 | Description: The image for setting up the the foobar handler is missing. https://github.com/telerik/fiddler-core-docs/issues?state=open
21 |
22 |
23 |
24 |
Note: When creating issues, please don't modify the assignee or milestone fields. Also, please create one issue per fix or change. "Bundled" entries will be deleted.
25 |
26 |
27 |
28 |
29 |
Send us a pull request - Creating an issue is great--and we certainly appreciate them--but what we really love are pull requests. So, if you find an issue in the docs, or even feel like creating new content, we'd be happy to have your contributions! If you're just getting started with open source, Git, and GitHub, we suggest you first read up on forking repos and sending pull requests, both great articles from the GitHub bootcamp.
30 |
31 |
Once you've read these--or you've already memorized them--you're ready to contribute to the FiddlerCore docs. Start by creating a local clone of our repo either using GitHub for Windows, GitHub for Mac or your friendly command-line:
Then, open up the fiddler-core-docs folder in your favorite text editor and contribute away! Of course, as you work with the docs, we do ask that you follow a couple of ground rules:
37 |
38 |
39 |
Fixing grammar, punctuation, and other general errors is always appreciated. So are changes that expand on key ideas or correct errors in logic phrasing or otherwise. If your ambitions are greater, however, and you want to add completely new content to the site we suggest you contact a member of the team first (or enter an issue!) to vet your idea. We would all be happy to hear your idea and offer advice.
40 |
41 |
Each document in this repo contains a section of YAML Front Matter at the very top. This content, which looks like the text below, is used by our auto-import tool when content is processed for the www.fiddler2.com/docs site. Please don't edit the content in this section of a document.
42 |
43 |
44 |
title: Add stuff to FiddlerCore
45 |
46 |
slug: howto-add-stuff
47 |
48 |
tags: How-To
49 |
50 |
publish: true
51 |
52 |
53 |
54 |
When adding content or making changes, please use only standard Markdown syntax, and make sure to preview your additions or changes before sending us a pull request.
55 |
56 |
Once you've made your changes, commit, pull, merge, push, and send us a pull request! We--and FiddlerCore users everywhere--thank you for making our docs better!
57 |
58 |
59 |
--------------------------------------------------------------------------------
/_assetsApi/api/index.md:
--------------------------------------------------------------------------------
1 |
84 |
85 | # Telerik FiddlerCore API Reference
86 | The API reference section of the documentation contains a list and descriptions of all public available classes, methods and properties of the Telerik FiddlerCore product.
87 |
88 | ## Namespaces
89 |
90 | | Namespaces | Description |
91 | | -----------| ----------- |
92 | | [Fiddler](/fiddler-core/api/fiddler) | In: *FiddlerCore.dll* This namespace must be included to any FiddlerCore project. |
93 | | [Telerik.NetworkConnections](/fiddler-core/api/telerik.networkconnections) | In: *Telerik.NetworkConnections.dll* |
94 | | [Telerik.NetworkConnections.Windows](/fiddler-core/api/telerik.networkconnections.windows) | In: *Telerik.NetworkConnections.dll* |
95 | | [Telerik.NetworkConnections.Linux](/fiddler-core/api/telerik.networkconnections.linux) | In: *Telerik.NetworkConnections.dll* |
96 | | [Telerik.NetworkConnections.Mac](/fiddler-core/api/telerik.networkconnections.mac) | In: *Telerik.NetworkConnections.dll* |
97 |
--------------------------------------------------------------------------------
/_assetsApi/docfx-tmpl/src/partials/docsearch.tmpl.partial:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
28 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/_assetsApi/docfx-tmpl/src/partials/footer.tmpl.partial:
--------------------------------------------------------------------------------
1 |
96 |
--------------------------------------------------------------------------------
/_assetsApi/docfx-tmpl/src/styles/docfx.js:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
2 | $(function () {
3 | var active = 'active';
4 | var expanded = 'in';
5 | var collapsed = 'collapsed';
6 | var filtered = 'filtered';
7 | var show = 'show';
8 | var hide = 'hide';
9 | var util = new utility();
10 |
11 | workAroundFixedHeaderForAnchors();
12 | highlight();
13 | enableSearch();
14 |
15 | renderTables();
16 | renderAlerts();
17 | renderLinks();
18 | renderNavbar();
19 | renderSidebar(true);
20 | renderAffix();
21 | renderFooter();
22 | renderLogo();
23 |
24 | breakText();
25 | renderTabs();
26 |
27 | window.refresh = function (article) {
28 | // Update markup result
29 | if (typeof article == 'undefined' || typeof article.content == 'undefined')
30 | console.error("Null Argument");
31 | $("article.content").html(article.content);
32 |
33 | highlight();
34 | renderTables();
35 | renderAlerts();
36 | renderAffix();
37 | renderTabs();
38 | }
39 |
40 | // Add this event listener when needed
41 | // window.addEventListener('content-update', contentUpdate);
42 |
43 | function breakText() {
44 | $(".xref").addClass("text-break");
45 | var texts = $(".text-break");
46 | texts.each(function () {
47 | $(this).breakWord();
48 | });
49 | }
50 |
51 | // Styling for tables in conceptual documents using Bootstrap.
52 | // See http://getbootstrap.com/css/#tables
53 | function renderTables() {
54 | $('table').addClass('table table-bordered table-striped table-condensed').wrap('');
55 | }
56 |
57 | // Styling for alerts.
58 | function renderAlerts() {
59 | $('.NOTE, .TIP').addClass('alert alert-info');
60 | $('.WARNING').addClass('alert alert-warning');
61 | $('.IMPORTANT, .CAUTION').addClass('alert alert-danger');
62 | }
63 |
64 | // Enable anchors for headings.
65 | (function () {
66 | anchors.options = {
67 | placement: 'left',
68 | visible: 'touch'
69 | };
70 | anchors.add('article h2:not(.no-anchor), article h3:not(.no-anchor), article h4:not(.no-anchor)');
71 | })();
72 |
73 | // Open links to different host in a new window.
74 | function renderLinks() {
75 | if ($("meta[property='docfx:newtab']").attr("content") === "true") {
76 | $(document.links).filter(function () {
77 | return this.hostname !== window.location.hostname;
78 | }).attr('target', '_blank');
79 | }
80 | }
81 |
82 | // Enable highlight.js
83 | function highlight() {
84 | $('pre code').each(function (i, block) {
85 | hljs.highlightBlock(block);
86 | });
87 | $('pre code[highlight-lines]').each(function (i, block) {
88 | if (block.innerHTML === "") return;
89 | var lines = block.innerHTML.split('\n');
90 |
91 | queryString = block.getAttribute('highlight-lines');
92 | if (!queryString) return;
93 |
94 | var ranges = queryString.split(',');
95 | for (var j = 0, range; range = ranges[j++];) {
96 | var found = range.match(/^(\d+)\-(\d+)?$/);
97 | if (found) {
98 | // consider region as `{startlinenumber}-{endlinenumber}`, in which {endlinenumber} is optional
99 | var start = +found[1];
100 | var end = +found[2];
101 | if (isNaN(end) || end > lines.length) {
102 | end = lines.length;
103 | }
104 | } else {
105 | // consider region as a sigine line number
106 | if (isNaN(range)) continue;
107 | var start = +range;
108 | var end = start;
109 | }
110 | if (start <= 0 || end <= 0 || start > end || start > lines.length) {
111 | // skip current region if invalid
112 | continue;
113 | }
114 | lines[start - 1] = '' + lines[start - 1];
115 | lines[end - 1] = lines[end - 1] + '';
116 | }
117 |
118 | block.innerHTML = lines.join('\n');
119 | });
120 | }
121 |
122 | // Support full-text-search
123 | function enableSearch() {
124 | var query;
125 | var relHref = $("meta[property='docfx\\:rel']").attr("content");
126 | if (typeof relHref === 'undefined') {
127 | return;
128 | }
129 | try {
130 | var worker = new Worker(relHref + 'styles/search-worker.js');
131 | if (!worker && !window.worker) {
132 | localSearch();
133 | } else {
134 | webWorkerSearch();
135 | }
136 |
137 | renderSearchBox();
138 | highlightKeywords();
139 | addSearchEvent();
140 | } catch (e) {
141 | console.error(e);
142 | }
143 |
144 | //Adjust the position of search box in navbar
145 | function renderSearchBox() {
146 | autoCollapse();
147 | $(window).on('resize', autoCollapse);
148 | $(document).on('click', '.navbar-collapse.in', function (e) {
149 | if ($(e.target).is('a')) {
150 | $(this).collapse('hide');
151 | }
152 | });
153 |
154 | function autoCollapse() {
155 | var navbar = $('#autocollapse');
156 | if (navbar.height() === null) {
157 | setTimeout(autoCollapse, 300);
158 | }
159 | navbar.removeClass(collapsed);
160 | if (navbar.height() > 60) {
161 | navbar.addClass(collapsed);
162 | }
163 | }
164 | }
165 |
166 | // Search factory
167 | function localSearch() {
168 | console.log("using local search");
169 | var lunrIndex = lunr(function () {
170 | this.ref('href');
171 | this.field('title', { boost: 50 });
172 | this.field('keywords', { boost: 20 });
173 | });
174 | lunr.tokenizer.seperator = /[\s\-\.]+/;
175 | var searchData = {};
176 | var searchDataRequest = new XMLHttpRequest();
177 |
178 | var indexPath = relHref + "index.json";
179 | if (indexPath) {
180 | searchDataRequest.open('GET', indexPath);
181 | searchDataRequest.onload = function () {
182 | if (this.status != 200) {
183 | return;
184 | }
185 | searchData = JSON.parse(this.responseText);
186 | for (var prop in searchData) {
187 | if (searchData.hasOwnProperty(prop)) {
188 | lunrIndex.add(searchData[prop]);
189 | }
190 | }
191 | }
192 | searchDataRequest.send();
193 | }
194 |
195 | $("body").bind("queryReady", function () {
196 | var hits = lunrIndex.search(query);
197 | var results = [];
198 | hits.forEach(function (hit) {
199 | var item = searchData[hit.ref];
200 | results.push({ 'href': item.href, 'title': item.title, 'keywords': item.keywords });
201 | });
202 | handleSearchResults(results);
203 | });
204 | }
205 |
206 | function webWorkerSearch() {
207 | console.log("using Web Worker");
208 | var indexReady = $.Deferred();
209 |
210 | worker.onmessage = function (oEvent) {
211 | switch (oEvent.data.e) {
212 | case 'index-ready':
213 | indexReady.resolve();
214 | break;
215 | case 'query-ready':
216 | var hits = oEvent.data.d;
217 | handleSearchResults(hits);
218 | break;
219 | }
220 | }
221 |
222 | indexReady.promise().done(function () {
223 | $("body").bind("queryReady", function () {
224 | worker.postMessage({ q: query });
225 | });
226 | if (query && (query.length >= 3)) {
227 | worker.postMessage({ q: query });
228 | }
229 | });
230 | }
231 |
232 | // Highlight the searching keywords
233 | function highlightKeywords() {
234 | var q = url('?q');
235 | if (q !== null) {
236 | var keywords = q.split("%20");
237 | keywords.forEach(function (keyword) {
238 | if (keyword !== "") {
239 | $('.data-searchable *').mark(keyword);
240 | $('article *').mark(keyword);
241 | }
242 | });
243 | }
244 | }
245 |
246 | function addSearchEvent() {
247 | $('body').bind("searchEvent", function () {
248 | $('#search-query').keypress(function (e) {
249 | return e.which !== 13;
250 | });
251 |
252 | $('#search-query').keyup(function () {
253 | query = $(this).val();
254 | if (query.length < 3) {
255 | flipContents("show");
256 | } else {
257 | flipContents("hide");
258 | $("body").trigger("queryReady");
259 | $('#search-results>.search-list').text('Search Results for "' + query + '"');
260 | }
261 | }).off("keydown");
262 | });
263 | }
264 |
265 | function flipContents(action) {
266 | if (action === "show") {
267 | $('.hide-when-search').show();
268 | $('#search-results').hide();
269 | } else {
270 | $('.hide-when-search').hide();
271 | $('#search-results').show();
272 | }
273 | }
274 |
275 | function relativeUrlToAbsoluteUrl(currentUrl, relativeUrl) {
276 | var currentItems = currentUrl.split(/\/+/);
277 | var relativeItems = relativeUrl.split(/\/+/);
278 | var depth = currentItems.length - 1;
279 | var items = [];
280 | for (var i = 0; i < relativeItems.length; i++) {
281 | if (relativeItems[i] === '..') {
282 | depth--;
283 | } else if (relativeItems[i] !== '.') {
284 | items.push(relativeItems[i]);
285 | }
286 | }
287 | return currentItems.slice(0, depth).concat(items).join('/');
288 | }
289 |
290 | function extractContentBrief(content) {
291 | var briefOffset = 512;
292 | var words = query.split(/\s+/g);
293 | var queryIndex = content.indexOf(words[0]);
294 | var briefContent;
295 | if (queryIndex > briefOffset) {
296 | return "..." + content.slice(queryIndex - briefOffset, queryIndex + briefOffset) + "...";
297 | } else if (queryIndex <= briefOffset) {
298 | return content.slice(0, queryIndex + briefOffset) + "...";
299 | }
300 | }
301 |
302 | function handleSearchResults(hits) {
303 | var numPerPage = 10;
304 | $('#pagination').empty();
305 | $('#pagination').removeData("twbs-pagination");
306 | if (hits.length === 0) {
307 | $('#search-results>.sr-items').html('