Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions _includes/badge-generator.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<form class="form-horizontal" id="shield-form">
<div class="form-group">
<label for="version" class="col-sm-2 control-label">Version</label>
<label for="version-sel" class="col-sm-2 control-label">Version</label>
<div class="col-sm-4">
<select class="form-control" id="version-sel">
{% for item in site.data.library.versions reversed %}
Expand All @@ -10,7 +10,7 @@
</div>
</div>
<div class="form-group">
<label for="style" class="col-sm-2 control-label">Style</label>
<label for="style-sel" class="col-sm-2 control-label">Style</label>
<div class="col-sm-4">
<select class="form-control" id="style-sel">
<option>Markdown</option>
Expand All @@ -19,20 +19,21 @@
</div>
</div>
<div class="form-group">
<label for="style" class="col-sm-2 control-label">Preview</label>
<label class="col-sm-2 control-label">Preview</label>
<div class="col-sm-4">
<img id="shield" src="">
</div>
</div>
<div class="form-group">
<label for="shieldCode" class="col-sm-2 control-label">Code</label>
<div class="col-sm-9">
<input type="text" id="shieldCode" class="form-control" rows="1" style="font-family:monospace;font-size:0.8em;"></input>
<input type="text" id="shieldCode" class="form-control" style="font-family:monospace;font-size:0.8em;">
</div>
<div class="col-sm-1">
<div class="div-clipboard">
<button id="shieldCodeBtn" class="btn btn-default btn-xs btn-clipboard" data-clipboard-text='' title='Copy to clipboard'><img
class="clippy" width="13" src="{{ "/assets/img/clippy.svg" | prepend: site.baseurl }}"></img></button>
class="clippy" width="13" src="{{ "/assets/img/clippy.svg" | prepend: site.baseurl }}">
</button>
</div>
</div>
</div>
Expand All @@ -43,8 +44,8 @@
var version = $("#version-sel").val();
var style = $("#style-sel").val();
$("#shield").attr("src", "/assets/badges/scalajs-"+version+".svg");
var code = style == "Markdown" ? "[![Scala.js](http://scala-js.org/assets/badges/scalajs-"+version+".svg)](http://scala-js.org)" :
'<img src="http://scala-js.org/assets/badges/scalajs-'+version+'.svg">';
var code = style == "Markdown" ? "[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-"+version+".svg)](https://www.scala-js.org)" :
'<img src="https://www.scala-js.org/assets/badges/scalajs-'+version+'.svg">';
$("#shieldCode").val(code);
$("#shieldCodeBtn").attr("data-clipboard-text", code);
}
Expand Down
7 changes: 7 additions & 0 deletions libraries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ Make sure your code starts correct and stays correct.
### [Project Skeletons](skeletons.html)
Get started quickly.

### Add a Scala.js badge on your library site

Show your true colors by adding a Scala.js badge on your site! Select the lowest Scala.js version your library is compatible with.

{% include badge-generator.html %}

<small markdown="1">Badge images generated with <a href="https://shields.io">shields.io</a></small>
8 changes: 0 additions & 8 deletions libraries/libs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@ just click on the dependency clipboard button to get the relevant SBT dependency
<small markdown="1">Additions and corrections to this section may be reported through
[GitHub issues](https://github.com/scala-js/scala-js-website/issues). Please include Name, Url, Description and
Dependency</small>

## Add a Scala.js shield on your library site

Show your true colors by adding a Scala.js shield on your site! Select the lowest Scala.js version your library is compatible with.

{% include badge-generator.html %}

<small markdown="1">Shield images generated with <a href="https://shields.io">shields.io</a></small>