-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fixes #5244 Add examples component * Show case basic prebid example * Migrate all examples in dev-docs * Add source panel this is still missing the prebid.js and other javascripts that might be necessary * Implement source tab and create better styling * document scripts include * add gpt.js as default include * disable bare urls lint on script * fix bare url lint * fix bare url lint * fix bare url linting * fix lint on bare url * remove lint override * disable bare url lint file * update rule * update rule number * update rule number --------- Co-authored-by: Chris Huie <[email protected]>
- Loading branch information
Showing
17 changed files
with
1,592 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!-- markdownlint-disable MD034 --> | ||
<script async | ||
type="text/plain" | ||
class="cmplazyload" | ||
data-cmp-purpose="c51" | ||
data-cmp-src="https://acdn.adnxs.com/ast/ast.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!-- markdownlint-disable MD034 --> | ||
<!-- | ||
provide the following variables: | ||
- id: unique id for the example | ||
- html: html code snippet | ||
- js: js code snippet | ||
- scripts: a commad separate list of required scripts. Allowed values are pbjs,gpt,astjs . default is pbjs,ast | ||
---> | ||
<ul class="nav nav-tabs" role="tablist"> | ||
<li class="nav-item ui-tab" role="presentation"> | ||
<button class="nav-link active" id="{{ include.id }}-result-tab" data-toggle="tab" data-target="#{{ include.id }}-result" type="button" role="tab" aria-controls="result" aria-selected="true">result</button> | ||
</li> | ||
<li class="nav-item ui-tab" role="presentation"> | ||
<button class="nav-link" id="{{ include.id }}-html-tab" data-toggle="tab" data-target="#{{ include.id }}-html" type="button" role="tab" aria-controls="html" aria-selected="false">html</button> | ||
</li> | ||
<li class="nav-item ui-tab" role="presentation"> | ||
<button class="nav-link" id="{{ include.id }}-js-tab" data-toggle="tab" data-target="#{{ include.id }}-js" type="button" role="tab" aria-controls="js" aria-selected="false">js</button> | ||
</li> | ||
<li class="nav-item ui-tab" role="presentation"> | ||
<button class="nav-link" id="{{ include.id }}-source-tab" data-toggle="tab" data-target="#{{ include.id }}-source" type="button" role="tab" aria-controls="js" aria-selected="false">source</button> | ||
</li> | ||
</ul> | ||
<div class="tab-content mb-3" id="example-tab-content"> | ||
<div class="tab-pane fade show active" id="{{ include.id }}-result" role="tabpanel" aria-labelledby="{{ include.id }}-result-tab"> | ||
<div class="bg-light p-3 shadow-sm"> | ||
<!-- external required scripts --> | ||
{% assign scripts = include.scripts | split: "," %} | ||
{% for script in scripts %} | ||
{% if script == "pbjs" %} | ||
{% include prebidjs-non-prod.html %} | ||
{% elsif script == "gpt" %} | ||
{% include gptjs.html %} | ||
{% elsif script == "astjs" %} | ||
{% include astjs.html %} | ||
{% else %} | ||
script tag '{{ script }}' unknown | ||
{% endif %} | ||
{% else %} | ||
<!-- no required scripts defined, pbjs will be included by default --> | ||
{% include prebidjs-non-prod.html %} | ||
{% include gptjs.html %} | ||
{% endfor %} | ||
|
||
<!-- example code --> | ||
<script>{{ include.js }}</script> | ||
<!-- example html --> | ||
{{ include.html }} | ||
</div> | ||
</div> | ||
<div class="tab-pane fade" id="{{ include.id }}-html" role="tabpanel" aria-labelledby="{{ include.id }}-html-tab"> | ||
<pre class="mt-0 shadow-sm"><code class="language-html">{{ include.html | xml_escape}}</code></pre> | ||
</div> | ||
<div class="tab-pane fade" id="{{ include.id }}-js" role="tabpanel" aria-labelledby="{{ include.id }}-js-tab"> | ||
<pre class="mt-0 shadow-sm"><code class="language-javascript">{{ include.js }}</code></pre> | ||
</div> | ||
<div class="tab-pane fade" id="{{ include.id }}-source" role="tabpanel" aria-labelledby="{{ include.id }}-source-tab"> | ||
<pre class="mt-0 shadow-sm"><code class="language-html"><html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>{{ page.title }}</title> | ||
|
||
<!-- required scripts --> | ||
{% assign scripts = include.scripts | split: "," %}{% for script in scripts %}{% if script == "pbjs" %}<script async src="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js"></script> | ||
{% elsif script == "gpt" %}<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> | ||
{% elsif script == "astjs" %}<script async src="https://acdn.adnxs.com/ast/ast.js"></script>{% else %}<!-- unknown script tag '{{ script }}' required -->{% endif %}{% else %}<script async src="//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js"></script> | ||
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>{% endfor %} | ||
</head> | ||
<body> | ||
|
||
<!-- javascript --> | ||
<script>{{ include.js }}</script> | ||
|
||
<!-- html --> | ||
{{ include.html | xml_escape}} | ||
</body> | ||
</html> | ||
</code></pre> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<!-- markdownlint-disable MD034 --> | ||
<!-- non-production version of prebid.js--> | ||
<script type="text/plain" class="cmplazyload" data-cmp-vendor="s1442" async src="//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js"></script> | ||
<script type="text/plain" class="cmplazyload" data-cmp-vendor="s1442" async data-cmp-src="https//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.