added site files
This commit is contained in:
parent
a6f70a6c78
commit
329148c253
253 changed files with 30486 additions and 0 deletions
13
EnlighterJS/Resources/social-buttons/LICENSE.md
Normal file
13
EnlighterJS/Resources/social-buttons/LICENSE.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
Copyright 2014 Mark Otto, 2014-2015 Andi Dittrich
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
143
EnlighterJS/Resources/social-buttons/social-buttons.css
Normal file
143
EnlighterJS/Resources/social-buttons/social-buttons.css
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
---
|
||||
description: GitHub-Buttons Styles - Improved for use within own pages
|
||||
|
||||
license: Apache 2.0 License
|
||||
|
||||
authors:
|
||||
- Mark Otto
|
||||
- github-buttons contributors (https://github.com/mdo/github-buttons)
|
||||
- Andi Dittrich
|
||||
...
|
||||
*/
|
||||
|
||||
.social-button{
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
height: 20px;
|
||||
font: bold 11px/14px "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.social-btn,
|
||||
.social-count {
|
||||
float: left;
|
||||
padding: 2px 5px 2px 4px;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.social-btn {
|
||||
background-color: #eee;
|
||||
background-image: linear-gradient(to bottom, #fcfcfc 0, #eee 100%);
|
||||
background-repeat: no-repeat;
|
||||
border: 1px solid #d5d5d5;
|
||||
}
|
||||
.social-btn:hover,
|
||||
.social-btn:focus {
|
||||
text-decoration: none;
|
||||
background-color: #ddd;
|
||||
background-image: linear-gradient(to bottom, #eee 0, #ddd 100%);
|
||||
border-color: #ccc;
|
||||
}
|
||||
.social-btn:active {
|
||||
background-image: none;
|
||||
background-color: #dcdcdc;
|
||||
border-color: #b5b5b5;
|
||||
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.github-ico {
|
||||
float: left;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 4px;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjQwcHgiIGhlaWdodD0iNDBweCIgdmlld0JveD0iMTIgMTIgNDAgNDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMTIgMTIgNDAgNDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGZpbGw9IiMzMzMzMzMiIGQ9Ik0zMiAxMy40Yy0xMC41IDAtMTkgOC41LTE5IDE5YzAgOC40IDUuNSAxNS41IDEzIDE4YzEgMC4yIDEuMy0wLjQgMS4zLTAuOWMwLTAuNSAwLTEuNyAwLTMuMiBjLTUuMyAxLjEtNi40LTIuNi02LjQtMi42QzIwIDQxLjYgMTguOCA0MSAxOC44IDQxYy0xLjctMS4yIDAuMS0xLjEgMC4xLTEuMWMxLjkgMC4xIDIuOSAyIDIuOSAyYzEuNyAyLjkgNC41IDIuMSA1LjUgMS42IGMwLjItMS4yIDAuNy0yLjEgMS4yLTIuNmMtNC4yLTAuNS04LjctMi4xLTguNy05LjRjMC0yLjEgMC43LTMuNyAyLTUuMWMtMC4yLTAuNS0wLjgtMi40IDAuMi01YzAgMCAxLjYtMC41IDUuMiAyIGMxLjUtMC40IDMuMS0wLjcgNC44LTAuN2MxLjYgMCAzLjMgMC4yIDQuNyAwLjdjMy42LTIuNCA1LjItMiA1LjItMmMxIDIuNiAwLjQgNC42IDAuMiA1YzEuMiAxLjMgMiAzIDIgNS4xYzAgNy4zLTQuNSA4LjktOC43IDkuNCBjMC43IDAuNiAxLjMgMS43IDEuMyAzLjVjMCAyLjYgMCA0LjYgMCA1LjJjMCAwLjUgMC40IDEuMSAxLjMgMC45YzcuNS0yLjYgMTMtOS43IDEzLTE4LjFDNTEgMjEuOSA0Mi41IDEzLjQgMzIgMTMuNHoiLz48L3N2Zz4=');
|
||||
}
|
||||
.wordpress-ico {
|
||||
float: left;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 4px;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2BJREFUeNpcU11MU2cYfs5PhRXoD1iko5QWKj+6tjJ/ICqaOOdwms3oxTYniZnLsmQXSyR6tSxm2YUxmTdLlgzmLuayzSyZPxNdNMQwSAe6AaUxUCn9NdaD0Ha0pVDac/Z+Ry7MTvKcnO/9nuc57/t978vZz/Thf08z4SPCXsKWtdgEYZDQS/C/SBbZq8PpVhcjPu9pgec/O7C5fvKd9ma+vlRJs3hkmeOvjPq33nkY+asoy18S/+IaH9xaBusI182GsobvP+jivcG4wzMdRUhKYKVQRGNNJfa7HXDba2a6+24p8VQ2SPy3CXnBuOstZvCVo9rwypWPD1vPXx02Dz4MYyGTg6wAHMcjlV3BWDCO1aJc1XeqS9vvDa4kssuNpLvDMnBS2oPj57qlS/e8LYWiDI8/hh0bayHyvFpagswmwhJ+6zmKEo2IXL4Qc33+QzmVs5sxTr3pso+LAtfy6cFt2NVcC17UQAGP04e2o+fwDsiUBS+K8D9Nqobp3Eod0zAtM+jq3tmq/2bAp25qS0uwSuKRoITRWUmNGcpegkCmv96fVdfj0XkwDdMyA7u7rto+EppHdCGDFrMRujItOEEDz0wciqJg3yYLHQaPWCqrGgwH5tC0obKBPmvVIqkmTtSsw8D0E2gEHnuazIAiw1alVQVt9SaUCwrWV2gRmU8jNJeEwHNsS2AG0UdSImg16eGJJOnkFXSSQXE1j1pdCW78eZ9YPNosBnSYS9E/NoOy4hKm4gvsKqPM4I/Lnql/OxurkckrGH+covT0eNVmwkQggt+H/gH71xtbHHDaLBgYm8KeViuYhsJ3mUHvbV/I3V5f+chaVQ5POKGm/cnrbfg7NIdgYgnJbA6brRvwLJuHUa/Dga2tfqYh2iVm4KO7//n93puZM/uaMvHFZeRWi+qhxXOARleFoakYNRQwm1zCF++9ljnR158lzY9My6/NRM+MlJo79vXV2MltlkBBBqalReiN61FjqYOUk1lLosNuChz/9maEcUlzlgnVWWDD9FP3djSc/U4dpoNOm/fd9hbdTsfLNkbyBJ6EfxmdXrztC7vZMAUvfHjx+OUHz4eJ9Q6hnPULwVjh3O2qcHUeEQ0mVyGdsKgjW1H5uJB6NpmeHLqW9g1PUoi1ZIqQ+U+AAQBxOVz5xw02pQAAAABJRU5ErkJggg==');
|
||||
}
|
||||
|
||||
.twitter-ico {
|
||||
float: left;
|
||||
width: 20px;
|
||||
height: 14px;
|
||||
background: rgba(0, 0, 0, 0) url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAoCAYAAABq13MpAAAGcklEQVRYw+2YXUyTVxjHz4vJLiZGd7MtXi2LkZtdELM7lyzOG7Nk2RJvl8iujBiNV2JcMA0fwqCFEGCAfJRC+SyltqWFgnwUlIKAWB3yOVrAttQWC1ZCOi6ePc8LL74tVD6ly2KTf87J6Tnv+3uf8zzP+WAAwEhMIj8h1MViEs0Jlqi+we5o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aTg8b+kD0Efoj9P8WWiKRbHnmo/bExMQbWEqwjBPawvU/VOjk5GQ9gmxagdLS0qzZ2dmQm5sLWVlZkJ6e3pmamjqD5eWIQ8vlcjtBpaSkyAUrIlxsQUEBKJVKqK6uhsrKSigrK4Pi4uLA48eP4yMO3dfXZyovLweCzMjIWCT4e/fuySsqKkCtVkNjYyNf1tXVwdjY2K7PiB8EurS01FpTUwO1tbVA8AgM2MZDErAgsvgez4gHD22325UqlWqVrEmqr6/nJVhZsDSW/v288NatW++9sFkPcjm6po9EdcFdqbx9+3Zs0LbUYrGMazSaVbFlxcKPgqGhIfNegfGlsRjwS1SGA6bAz8/P52eZRHV0Vyu5KyUA9IIrQYMGBwfT9Xr9kti6YivrdLr9nBEZBvHNvLw8ykIEvunCRiaTJRQVFQG5aUNDAy+qU/CTuyLwWyyNm86IDoejsaOjwxPqFkaj0b+8vLyvMyIaJV6hUPAxk5OTA2g5DcJvuAvOZD1lqtB30wxTbLW1tfEXNhvTkpSUJM/MzPQJKY6+UhjU3d3tWgfe75HrVE9PzxzFCr2jsLAQpFIppdlh/ABJVVXVECWCrWYZPcAfesPEnxHRyube3l4b5mAbWsU2ir/FxcUDOyOiv8ahpb0UN0L6pJRaUlIC5BY0A2TVUGgyII5xRuSM6Ha7LyJkgMDEuV+YfnG7WDQzDx48sERqwxTtdDrNFB9bwYUTBSNO+p2I7fImJyfPoF8PNTc37wic+hgMhqALm0isaNEIY6KVdSfQ5BoTExOq/8J++ioFOAV7S0tLWItTOyWF0AubiO0fMOjO42JlwgAMhFvMMJNteWFzqKC0j8Cc3Il7cR/t0SnVUZCFLiaYk1empqbCXtgctoUTcO+iQ5eYRUuv0EJCOZhAtVrtaldXl2dkZGTbC5tIuMa+L2z+BexZXK+OBaruAAAAAElFTkSuQmCC') 0 0 no-repeat;
|
||||
background-position: -24px 0;
|
||||
margin-right: 4px;
|
||||
vertical-align: 3px;
|
||||
}
|
||||
|
||||
.social-count {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-left: 4px;
|
||||
background-color: #fafafa;
|
||||
border: 1px solid #d4d4d4;
|
||||
}
|
||||
.social-count:hover,
|
||||
.social-count:focus {
|
||||
color: #4183C4;
|
||||
}
|
||||
.social-count:before,
|
||||
.social-count:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
}
|
||||
.social-count:before {
|
||||
top: 50%;
|
||||
left: -3px;
|
||||
margin-top: -4px;
|
||||
border-width: 4px 4px 4px 0;
|
||||
border-right-color: #fafafa;
|
||||
}
|
||||
.social-count:after {
|
||||
top: 50%;
|
||||
left: -4px;
|
||||
z-index: -1;
|
||||
margin-top: -5px;
|
||||
border-width: 5px 5px 5px 0;
|
||||
border-right-color: #d4d4d4;
|
||||
}
|
||||
.social-btn-large {
|
||||
height: 30px;
|
||||
}
|
||||
.social-btn-large .social-btn,
|
||||
.social-btn-large .social-count {
|
||||
padding: 3px 10px 3px 8px;
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.social-btn-large .social-ico {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.social-btn-large .social-count {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.social-btn-large .social-count:before {
|
||||
left: -5px;
|
||||
margin-top: -6px;
|
||||
border-width: 6px 6px 6px 0;
|
||||
}
|
||||
.social-btn-large .social-count:after {
|
||||
left: -6px;
|
||||
margin-top: -7px;
|
||||
border-width: 7px 7px 7px 0;
|
||||
}
|
165
EnlighterJS/Resources/social-buttons/social-buttons.js
Normal file
165
EnlighterJS/Resources/social-buttons/social-buttons.js
Normal file
|
@ -0,0 +1,165 @@
|
|||
(function(_w){
|
||||
|
||||
var defaultOptions = {
|
||||
// large or small button ?
|
||||
large: false,
|
||||
|
||||
// Button type github-(star, fork, watch, follow), twitter-(follow, tweets)
|
||||
type: 'github-star',
|
||||
|
||||
// custom button text
|
||||
text: null,
|
||||
|
||||
// github/twitter username
|
||||
username: '',
|
||||
|
||||
// github repository name
|
||||
repo: '',
|
||||
|
||||
// wordpress plugin name
|
||||
plugin: ''
|
||||
};
|
||||
|
||||
// global "socialbutton" function
|
||||
_w.SocialButton = (function(target, opt){
|
||||
var options = Object.merge({}, defaultOptions, opt || {});
|
||||
|
||||
// urls
|
||||
var textUrl = '';
|
||||
var counterUrl = '';
|
||||
|
||||
// website urls
|
||||
var githubUserUrl = 'https://github.com/' + options.username + '/';
|
||||
var githubRepoUrl = githubUserUrl + options.repo + '/';
|
||||
var twitterUserUrl = 'https://twitter.com/' + options.username + '/'
|
||||
var twitterFollowerUrl = twitterUserUrl + 'followers';
|
||||
var wordpressUserUrl = 'https://profiles.wordpress.org/' + options.username + '/';
|
||||
var wordpressPluginUrl = 'https://wordpress.org/plugins/' + options.plugin.toLowerCase() + '/';
|
||||
|
||||
// text to display
|
||||
var text = '-';
|
||||
|
||||
// counter value
|
||||
var count = 0;
|
||||
|
||||
// icon type
|
||||
var iconType = 'twitter';
|
||||
|
||||
// star, fork, follow, watch are supported
|
||||
switch (options.type){
|
||||
case 'github-star':
|
||||
text = 'Star #' + options.repo;;
|
||||
textUrl = githubRepoUrl;
|
||||
counterUrl = githubRepoUrl + 'stargazers';
|
||||
count = _w._github_profile.repos[options.repo].stargazers;
|
||||
iconType = 'github';
|
||||
break;
|
||||
|
||||
case 'github-fork':
|
||||
text = 'Fork #' + options.repo;
|
||||
textUrl = githubRepoUrl;
|
||||
counterUrl = githubRepoUrl + 'network';
|
||||
count = _w._github_profile.repos[options.repo].forks;
|
||||
iconType = 'github';
|
||||
break;
|
||||
|
||||
case 'github-followers':
|
||||
text = 'Follow @' + options.username;
|
||||
textUrl = githubRepoUrl;
|
||||
counterUrl = githubUserUrl + 'followers';
|
||||
count = _w._github_profile.user.followers;
|
||||
iconType = 'github';
|
||||
break;
|
||||
|
||||
case 'github-opensource':
|
||||
text = 'OpenSource @' + options.username;
|
||||
textUrl = githubRepoUrl;
|
||||
counterUrl = githubUserUrl + '?tab=repositories';
|
||||
count = Object.keys(_w._github_profile.repos).length;
|
||||
iconType = 'github';
|
||||
break;
|
||||
|
||||
case 'twitter-followers':
|
||||
text = 'Follow @' + options.username;
|
||||
textUrl = twitterUserUrl;
|
||||
counterUrl = twitterFollowerUrl;
|
||||
count = _w._twitter_profile.user.followers;
|
||||
iconType = 'twitter';
|
||||
break;
|
||||
|
||||
case 'twitter-tweets':
|
||||
text = 'Tweets @' + options.username;
|
||||
textUrl = twitterUserUrl;
|
||||
counterUrl = twitterUserUrl;
|
||||
count = _w._twitter_profile.user.tweets;
|
||||
iconType = 'twitter';
|
||||
break;
|
||||
|
||||
case 'wordpress-user':
|
||||
text = 'Plugins @' + options.username;
|
||||
textUrl = wordpressUserUrl;
|
||||
counterUrl = wordpressUserUrl + '#content-plugins';
|
||||
count = Object.keys(_w._wordpress_profile.plugins).length;
|
||||
iconType = 'wordpress';
|
||||
break;
|
||||
|
||||
case 'wordpress-plugin':
|
||||
text = options.plugin;
|
||||
textUrl = wordpressPluginUrl;
|
||||
counterUrl = wordpressPluginUrl + 'stats/';
|
||||
count = _w._wordpress_profile.plugins[options.plugin.toLowerCase()].downloads;
|
||||
iconType = 'wordpress';
|
||||
break;
|
||||
}
|
||||
|
||||
// text override ?
|
||||
if (options.text !== null){
|
||||
text = options.text;
|
||||
}
|
||||
|
||||
// create html structure
|
||||
// @see https://github.com/mdo/github-buttons/blob/master/github-btn.source.html
|
||||
// <span class="github-btn" id="github-btn">
|
||||
// <a class="gh-btn" id="gh-btn" href="#" target="_blank">
|
||||
// <span class="gh-ico"></span>
|
||||
// <span class="gh-text" id="gh-text"></span>
|
||||
// </a>
|
||||
// <a class="gh-count" id="gh-count" href="#" target="_blank"></a>
|
||||
// </span>
|
||||
|
||||
// create elements
|
||||
var buttonContainer = new Element('div', {
|
||||
'class': 'social-button ' + (options.large ? 'social-btn-large' : '')
|
||||
});
|
||||
var counter = new Element('a', {
|
||||
'class': 'social-count',
|
||||
href: counterUrl,
|
||||
target: '_blank',
|
||||
text: count
|
||||
});
|
||||
var ico = new Element('span', {
|
||||
'class': iconType + '-ico'
|
||||
});
|
||||
var txt = new Element('span', {
|
||||
'class': 'social-text',
|
||||
text: text
|
||||
});
|
||||
var button = new Element('a', {
|
||||
'class': 'social-btn',
|
||||
href: textUrl,
|
||||
target: '_blank'
|
||||
});
|
||||
|
||||
// create structure
|
||||
button.grab(ico).grab(txt);
|
||||
buttonContainer.grab(button);
|
||||
|
||||
// count set ?
|
||||
if (count != null){
|
||||
buttonContainer.grab(counter);
|
||||
}
|
||||
|
||||
target.grab(buttonContainer);
|
||||
});
|
||||
|
||||
})(window);
|
Loading…
Add table
Add a link
Reference in a new issue