Permalink
Browse files

replace Flash content by clipboard.js

  • Loading branch information...
1 parent 8746e03 commit 4fc2801563089eaa9c2cd70a0c73bbb9ac7074c2 @mhutter mhutter committed Sep 30, 2016
Showing with 21 additions and 20 deletions.
  1. +7 −0 server/css/gc.css
  2. +0 −1 server/smain.go
  3. BIN server/static/clippy.swf
  4. +14 −19 server/web/view.html
View
@@ -327,6 +327,13 @@ div.markdown td {
padding: 0px 10px 0px 0px;
}
+.import-box {
+ margin-bottom: 1.5rem;
+}
+.import-box input {
+ font-family: monospace;
+}
+
@media only screen and (max-device-width: 480px) {
body {
margin: 0px auto;
View
@@ -59,7 +59,6 @@ func init() {
http.Handle("/images/", http.StripPrefix("/images/", http.FileServer(http.Dir(configs.ServerRoot.Join("images").S()))))
http.Handle("/img/", http.StripPrefix("/img/", http.FileServer(http.Dir(configs.ServerRoot.Join("images").S()))))
http.Handle("/robots.txt", http.FileServer(http.Dir(configs.ServerRoot.Join("static").S())))
- http.Handle("/clippy.swf", http.FileServer(http.Dir(configs.ServerRoot.Join("static").S())))
http.HandleFunc("/add", pageAdd)
http.HandleFunc("/search", pageSearch)
Binary file not shown.
View
@@ -42,24 +42,14 @@
</div><!-- /.container-fluid -->
</nav>
-<pre>import "{{.Package}}"<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="clippy"
- ><param name="movie" value="/clippy.swf"
- /><param name="allowScriptAccess" value="always"
- /><param name="quality" value="high"
- /><param name="scale" value="noscale"
- /><param NAME="FlashVars" value="text={{.Package}}"
- /><param name="bgcolor" value="#f5f5f5" /> <embed
- src="/clippy.swf"
- width="100"
- height="14"
- name="clippy"
- quality="high"
- allowScriptAccess="always"
- type="application/x-shockwave-flash"
- pluginspage="http://www.macromedia.com/go/getflashplayer"
- FlashVars="text={{.Package}}"
- bgcolor="#f5f5f5"
- /></object></pre>
+<div class="input-group import-box">
+ <span class="input-group-btn">
+ <button id="import-btn" data-clipboard-target="#import" class="btn btn-default">
+ <span class="glyphicon glyphicon-copy"></span>
+ </button>
+ </span>
+ <input id="import" type="text" class="form-control" value="import &quot;{{.Package}}&quot;" disabled="disabled">
+</div>
{{if .Description}}
<div class="panel panel-default">
@@ -113,7 +103,7 @@
function disqus_config() {
console.log('disqus_config');
- this.callbacks.onNewComment = [function(comment) {
+ this.callbacks.onNewComment = [function(comment) {
console.log('comment_create_callback');
ga('send', 'event', 'comment', '{{.Package}}', 'create');
}];
@@ -132,6 +122,11 @@
</div>
{{template "searchbox.html" .UIUtils.Slice "" false}}
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.12/clipboard.min.js"></script>
+<script>
+ new Clipboard(document.getElementById('import-btn'))
+</script>
+
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;

0 comments on commit 4fc2801

Please sign in to comment.