Skip to content

Commit

Permalink
Rename sampler.fetcherURL to sampler.proxyURL because it matches the …
Browse files Browse the repository at this point in the history
…purpose better
  • Loading branch information
ThomasWeinert committed Dec 7, 2018
1 parent 24aaa8f commit a1b3e16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ the option `sampler.removeIndentation`. The default value is `false`.
}
```

### Fetcher URL
Defining the fetcher URL will prefix all snippet requests with it.
### Proxy URL
Defining the proxy URL will prefix all snippet requests with it. This allows you to use a script to access the
snippet files.

```js
{
sampler : {
fetcherURL: 'task.php?file='
proxyURL: 'task.php?file='
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions sampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@
var config = Reveal.getConfig() || {};
config.sampler = config.sampler || {};
var options = {
fetcherURL: config.sampler.fetcherURL || '',
proxyURL: config.sampler.proxyURL || '',
removeIndentation: !!config.sampler.removeIndentation
};

var elements = document.querySelectorAll('[data-sample]');
elements.forEach(function(element) {
var slug = element.getAttribute('data-sample').match(/([^#]+)(?:#(.+))?/);
var file = options.fetcherURL + slug[1];
var file = options.proxyURL + slug[1];
var selector = slug[2];
var extractor = getSnippetExtractor(selector);

Expand Down

0 comments on commit a1b3e16

Please sign in to comment.