Docs: Remove unused GitHub:buttons files

The GitHub:buttons JavaScript code docs/static/js/buttons.js
from https://github.com/ntkme/github-buttons was referenced
in docs/layouts/partials/footer.html but never used.

Apparently, the actual code for the GitHub buttons on the upper-left
corner of gohugo.io documentation was written by @spf13 in
docs/static/js/scripts.js.
This commit is contained in:
Anthony Fok committed 2015-12-20 13:18:18 -07:00
1 parent 217d25f560
commit 7c84ad56cb
4 files changed
-1867

No files matched your search

-1
View File
@@ -29,7 +29,6 @@
<script src="/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/scripts.js"></script>
<script async defer id="github-bjs" src="/js/buttons.js"></script>
{{ template "partials/analytics.html" . }}
</body>
</html>
-1846
View File
File diff suppressed because it is too large. Load diff
-19
View File
@@ -1,19 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<base target="_blank"><!--[if lte IE 6]></base><![endif]-->
<link rel="stylesheet" href="buttons.css">
<!--[if lt IE 8]>
<link rel="stylesheet" href="assets/css/octicons-iefix.css">
<![endif]-->
<!--[if IE 8]>
<script src="assets/js/pseudo-ie8fix.js"></script>
<![endif]-->
<meta name="robots" content="noindex, nofollow">
</head>
<body>
<script src="buttons.js"></script>
</body>
</html>
-1
View File
@@ -1 +0,0 @@
(function(){var Button,ButtonElement,Config,CountElement,Iframe,QueryString,link,links,_i,_len;if(Config={api:"https://api.github.com",buttonClass:"github-button",iconClass:"octicon",icon:"octicon-mark-github",scriptId:"github-bjs",styles:["default","mega"]},(Config.script=document.getElementById(Config.scriptId))&&(Config.url=Config.script.src.replace(/buttons.js$/,"")),QueryString=function(){function QueryString(){}return QueryString.stringify=function(obj){var key,results,value;results=[];for(key in obj)value=obj[key],null==value&&(value=""),results.push(""+encodeURIComponent(key)+"="+encodeURIComponent(value));return results.join("&")},QueryString.parse=function(str){var obj,pair,_i,_len,_ref;for(obj={},_ref=str.split("&"),_i=0,_len=_ref.length;_len>_i;_i++)pair=_ref[_i],obj[decodeURIComponent(pair.split("=")[0])]=decodeURIComponent(pair.split("=").slice(1).join("="));return obj},QueryString}(),Iframe=function(){function Iframe(callback){var key,value,_ref,_ref1;this.iframe=document.createElement("iframe"),_ref={allowtransparency:!0,scrolling:"no",frameBorder:0};for(key in _ref)value=_ref[key],this.iframe.setAttribute(key,value);_ref1={border:"none",height:"0",width:"1px"};for(key in _ref1)value=_ref1[key],this.iframe.style[key]=value;callback&&callback(this.iframe)}return Iframe.prototype.on=function(event,func){return this.iframe.addEventListener?this.iframe.addEventListener(""+event,func):this.iframe.attachEvent&&this.iframe.attachEvent("on"+event,func),this},Iframe.prototype.once=function(event,func){var once;return once=function(_this){return function(){_this.iframe.removeEventListener?_this.iframe.removeEventListener(""+event,once):_this.iframe.detachEvent&&_this.iframe.detachEvent("on"+event,once),func()}}(this),this.on(event,once)},Iframe}(),Button=function(){function Button(a){a?(this.data=this.parseAnchor(a),this.iframe=new Iframe(function(iframe){a.parentNode.insertBefore(iframe,a)}),this.iframe.once("load",function(_this){return function(){var body,html,iframe,style;iframe=_this.iframe.iframe,html=iframe.contentWindow.document.documentElement,body=iframe.contentWindow.document.body,html.style.overflow=body.style.overflow="visible",style={height:""+body.scrollHeight+"px",width:""+body.scrollWidth+"px"},html.style.overflow=body.style.overflow="",_this.iframe.once("load",function(){var key,value;a.parentNode.removeChild(a),a=null;for(key in style)value=style[key],iframe.style[key]=value}),iframe.src=""+Config.url+"buttons.html"+_this.hash(_this.data)}}(this)),this.iframe.iframe.contentWindow.document.open(),this.iframe.iframe.contentWindow.document.write(this.html()),this.iframe.iframe.contentWindow.document.close()):(this.data=this.parseHash(),document.body.className=this.data.style,document.getElementsByTagName("base")[0].href=this.data.href,new ButtonElement(this.data,function(buttonElement){document.body.appendChild(buttonElement)}),new CountElement(this.data,function(countElement){document.body.appendChild(countElement)}))}return Button.prototype.parseAnchor=function(a){var filter_js,protocolPattern;return protocolPattern=/^([a-z0-9.+-]+:)/i,filter_js=function(href){var protocol;return protocol=protocolPattern.exec(href),protocol&&"javascript:"===protocol[0].toLowerCase()?"":href},{countApi:function(){var api;return api=a.getAttribute("data-count-api"),api?("/"!==api.charAt(0)&&(api="/"+api),api):null}(),countHref:function(){var href;return href=a.getAttribute("data-count-href"),href&&(href=filter_js(href))?href:filter_js(a.href)}(),href:function(){return filter_js(a.href)}(),style:function(){var i,style,_i,_len,_ref;if(style=a.getAttribute("data-style"))for(_ref=Config.styles,_i=0,_len=_ref.length;_len>_i;_i++)if(i=_ref[_i],i===style)return style;return Config.styles[0]}(),text:a.getAttribute("data-text")||a.textContent||a.innerText,icon:a.getAttribute("data-icon")||Config.icon}},Button.prototype.hash=function(data){return"#"+encodeURIComponent(QueryString.stringify(data))},Button.prototype.parseHash=function(){return QueryString.parse(decodeURIComponent(document.location.hash.replace(/^#/,"")))},Button.prototype.html=function(){return'<!DOCTYPE html>\n<html>\n <head>\n <meta charset="utf-8">\n <title></title>\n <base target="_blank"><!--[if lte IE 6]></base><![endif]-->\n <link rel="stylesheet" href="'+Config.url+'buttons.css">\n <style>html{visibility:hidden;}</style>\n <script>document.location.hash = "'+this.hash(this.data)+'";</script>\n </head>\n <body>\n <script src="'+Config.script.src+'"></script>\n </body>\n</html>'},Button}(),ButtonElement=function(){function ButtonElement(data,callback){var icon,text;this.data=data,icon=document.createElement("i"),icon.className=""+(Config.iconClass?""+Config.iconClass+" ":"")+data.icon,text=document.createElement("span"),data.text&&text.appendChild(document.createTextNode(" "+data.text+" ")),this.a=document.createElement("a"),this.a.className="button",data.href&&(this.a.href=data.href),this.a.appendChild(icon),this.aLine truncated