Merge pull request #1 from lefnire/master

Update my fork
This commit is contained in:
Shane Lister 2013-03-03 03:01:45 -08:00
commit 3d340539b4
328 changed files with 3856 additions and 3952 deletions

3
.gitignore vendored
View file

@ -3,4 +3,5 @@ public/gen
node_modules
#lib/
*.swp
.idea*
.idea*
config.json

21
.gitmodules vendored Normal file
View file

@ -0,0 +1,21 @@
[submodule "public/vendor/bootstrap-datepicker"]
path = public/vendor/bootstrap-datepicker
url = https://github.com/eternicode/bootstrap-datepicker.git
[submodule "public/vendor/bootstrap-growl"]
path = public/vendor/bootstrap-growl
url = https://github.com/ifightcrime/bootstrap-growl.git
[submodule "public/vendor/bootstrap"]
path = public/vendor/bootstrap
url = https://github.com/twitter/bootstrap.git
[submodule "public/vendor/github-buttons"]
path = public/vendor/github-buttons
url = https://github.com/mdo/github-buttons.git
[submodule "public/vendor/jquery-cookie"]
path = public/vendor/jquery-cookie
url = https://github.com/carhartl/jquery-cookie.git
[submodule "public/vendor/jquery-ui"]
path = public/vendor/jquery-ui
url = https://github.com/jquery/jquery-ui.git
[submodule "public/vendor/BrowserQuest"]
path = public/vendor/BrowserQuest
url = https://github.com/mozilla/BrowserQuest.git

15
config.json.example Normal file
View file

@ -0,0 +1,15 @@
{
"PORT":3000,
"IP":"0.0.0.0",
"BASE_URL":"http://localhost",
"FACEBOOK_KEY":"123456789012345",
"FACEBOOK_SECRET":"aaaabbbbccccddddeeeeffff00001111",
"NODE_DB_URI":"mongodb://localhost/habitrpg",
"NODE_ENV":"development",
"SESSION_SECRET":"YOUR SECRET HERE",
"SMTP_USER":"user@domain.com",
"SMTP_PASS":"password",
"SMTP_SERVICE":"Gmail",
"STRIPE_API_KEY":"aaaabbbbccccddddeeeeffff00001111",
"STRIPE_PUB_KEY":"22223333444455556666777788889999"
}

View file

@ -0,0 +1,19 @@
// move idList back to root-level, is what's causing the sort bug - see https://github.com/codeparty/racer/pull/73
// We could just delete user.idLists, since it's re-created on refresh. However, users's first refresh will scare them
// since everything will dissappear - second refresh will bring everything back.
db.users.find().forEach(function(user){
if (!user.idLists) return;
db.users.update(
{_id:user._id},
{
$set:{
'habitIds':user.idLists.habit,
'dailyIds':user.idLists.daily,
'todoIds':user.idLists.todo,
'rewardIds':user.idLists.reward
}
//$unset:{idLists:true} // run this after the code has been pushed
}
)
})

View file

@ -0,0 +1,20 @@
db.users.update(
{items:{$exists:0}},
{$set:{items:{weapon: 0, armor: 0, head: 0, shield: 0 }}},
{multi:true}
);
db.users.find().forEach(function(user){
var updates = {
// I'm not racist, these were just the defaults before ;)
'preferences.skin': 'white',
'preferences.hair': 'blond',
'items.head': user.items.armor,
'items.shield': user.items.armor,
}
db.users.update({_id:user._id}, {$set:updates});
})

View file

@ -0,0 +1,52 @@
/**
* Set this up as a midnight cron script
*
* mongo habitrpg node_modules/moment/moment.js migrations/json.js migrations/20130212_preen_cron.js
*/
/*
Users are allowed to experiment with the site before registering. Every time a new browser visits habitrpg, a new
"staged" account is created - and if the user later registeres, that staged account is considered a "production" account.
This function removes all staged accounts that have been abandoned - either older than a month, or corrupted in some way (lastCron==undefined)
*/
var un_registered = {
"auth.local": {$exists: false},
"auth.facebook": {$exists: false}
};
var registered = {
$or: [
{ 'auth.local': { $exists: true }},
{ 'auth.facebook': { $exists: true }}
]
};
var today = +(new Date);
// isValidDate = (d) ->
// return false if Object::toString.call(d) isnt "[object Date]"
// not isNaN(d.getTime())
db.users.find(un_registered).forEach(function(user) {
var diff, lastCron;
if (!user) return;
if (!!user.lastCron) {
lastCron = new Date(user.lastCron);
diff = Math.abs(moment(today).startOf('day').diff(moment(lastCron).startOf('day'), "days"));
if (diff > 3) {
return db.users.remove({_id:user._id});
}
} else {
return db.users.update({_id: user._id}, {$set: {lastCron: today}});
}
});
db.sessions.find().forEach(function(sess){
var uid = JSON.parse(sess.session).userId;
if (!uid || db.users.count({_id:uid}) === 0) {
db.sessions.remove({_id:sess._id});
}
});

529
migrations/json.js Normal file
View file

@ -0,0 +1,529 @@
/*
json.js
2012-10-08
Public Domain
No warranty expressed or implied. Use at your own risk.
This file has been superceded by http://www.JSON.org/json2.js
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file adds these methods to JavaScript:
object.toJSONString(whitelist)
This method produce a JSON text from a JavaScript value.
It must not contain any cyclical references. Illegal values
will be excluded.
The default conversion for dates is to an ISO string. You can
add a toJSONString method to any date object to get a different
representation.
The object and array methods can take an optional whitelist
argument. A whitelist is an array of strings. If it is provided,
keys in objects not found in the whitelist are excluded.
string.parseJSON(filter)
This method parses a JSON text to produce an object or
array. It can throw a SyntaxError exception.
The optional filter parameter is a function which can filter and
transform the results. It receives each of the keys and values, and
its return value is used instead of the original value. If it
returns what it received, then structure is not modified. If it
returns undefined then the member is deleted.
Example:
// Parse the text. If a key contains the string 'date' then
// convert the value to a date.
myData = text.parseJSON(function (key, value) {
return key.indexOf('date') >= 0 ? new Date(value) : value;
});
This file will break programs with improper for..in loops. See
http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or ' '),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the object holding the key.
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, regexp: true, unparam: true */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, parseJSON, prototype, push, replace, slice,
stringify, test, toJSON, toJSONString, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== 'object') {
JSON = {};
}
(function () {
'use strict';
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf()) ?
this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z' : null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0 ? '[]' : gap ?
'[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
'[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
k = rep[i];
if (typeof k === 'string') {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0 ? '{}' : gap ?
'{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
'{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function' ?
walk({'': j}, '') : j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
// Augment the basic prototypes if they have not already been augmented.
// These forms are obsolete. It is recommended that JSON.stringify and
// JSON.parse be used instead.
if (!Object.prototype.toJSONString) {
Object.prototype.toJSONString = function (filter) {
return JSON.stringify(this, filter);
};
Object.prototype.parseJSON = function (filter) {
return JSON.parse(this, filter);
};
}
}());

View file

@ -4,12 +4,12 @@
"version": "0.0.0-150",
"main": "./server.js",
"dependencies": {
"derby": "git://github.com/codeparty/derby#master",
"derby": "git://github.com/lefnire/derby#habitrpg",
"racer": "git://github.com/lefnire/racer#habitrpg",
"racer-db-mongo": "git://github.com/lefnire/racer-db-mongo#habitrpg",
"derby-ui-boot": "git://github.com/codeparty/derby-ui-boot#master",
"derby-auth": "git://github.com/lefnire/derby-auth#master",
"connect-mongo": "0.2.0",
"connect-mongo": "*",
"passport-facebook": "*",
"express": "*",
"gzippo": "*",
@ -18,9 +18,14 @@
"stripe": "*",
"async": "*",
"lodash": "*",
"coffee-script": "*",
"coffee-script": "1.4.x",
"underscore": "*",
"mongoskin": "*"
"mongoskin": "*",
"nconf": "*",
"icalendar": "git://github.com/lefnire/node-icalendar#master",
"resolve": "~0.2.3",
"browserify": "1.17.3",
"webkit-devtools-agent": "*"
},
"private": true,
"subdomain": "habitrpg",

View file

@ -5,9 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<link href="/vendor/bootstrap/docs/assets/css/bootstrap.css" rel="stylesheet">
<link href="/vendor/bootstrap/docs/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/vendor/bootstrap/docs/assets/css/docs.css" rel="stylesheet">
<style type="text/css">
.jumbotron {
@ -35,16 +35,9 @@
<body>
<div class='container'>
<div class='marketing'>
<img class='rotate-img' src="/img/BrowserQuest/habitrpg_mods/armor3.png" />
<h2>The server is under heavy load or is experiencing issues.</h2>
<p><a href="/">Try again</a> in a few, the developer has been notified. In the meantime, Habit could use your support to get these issues squared away - please consider backing the Kickstarter Campaign.</p>
<a href="http://kck.st/XoA3Yg" class='btn btn-success btn-large'>Kickstarter</a>
<div class='container'>
<div class='marketing'>
<p>&nbsp;</p>
<p><iframe src="http://player.vimeo.com/video/57639356" width="960" height="539" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
</div>
</div>
<img class='rotate-img' src="/img/sprites/armor3_m.png" />
<h2>The server is experiencing issues.</h2>
<p><a href="/">Try again</a> in a few, the developer has been notified. The most likely culprit is <a href="https://github.com/lefnire/habitrpg/issues/165">this issue</a> which Tyler is working frantically to fix. (Any memory leak experts?)</p>
</div>
</div>
</body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,24 +0,0 @@
# ALWAYS IGNORE
# -------------
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
# OS & EDITOR FOLDERS
# -------------------
.DS_Store
thumbs.db
# LOCAL TEST PAGE
# ---------------
test.html

View file

@ -1 +0,0 @@
ghbtns.com

View file

@ -1,154 +0,0 @@
UNOFFICIAL GITHUB BUTTONS
=========================
Showcase your GitHub (repo's) success with these three simple, static buttons featuring dynamic watch, fork and follower counts and a link to your GitHub repo or profile page.
To get started, checkout http://ghbtns.com!
Usage
-----
These buttons are hosted via GitHub Pages, meaning all you need to do is include an iframe and you're set. Once included, you can configure it with various options. Here's the include:
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=USERNAME&repo=REPONAME&type=BUTTONTYPE"
allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>
```
### Requirements
`user`<br>
GitHub username that owns the repo<br>
`repo`<br>
GitHub repository to pull the forks and watchers counts
`type`<br>
Type of button to show: `watch` or `fork` or `follow`
### Optional
`count`<br>
Show the optional watchers or forks count: *none* by default or `true`
`size`<br>
Optional flag for using a larger button: *none* by default or `large`
Examples
--------
**Basic Watch button**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&repo=github-buttons&type=watch"
allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>
```
**Basic Fork button**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&repo=github-buttons&type=fork"
allowtransparency="true" frameborder="0" scrolling="0" width="53" height="20"></iframe>
```
**Basic Follow button**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&type=follow"
allowtransparency="true" frameborder="0" scrolling="0" width="132" height="20"></iframe>
```
**Watch with count**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&repo=github-buttons&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe>
```
**Fork with count**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&repo=github-buttons&type=fork&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe>
```
**Follow with count**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&type=follow&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="165" height="20"></iframe>
```
**Large Watch button with count**
``` html
<iframe src="http://ghbtns.com/github-btn.html?user=markdotto&repo=github-buttons&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
```
Limitations
-----------
For the first version, functionality is limited and some concessions were made:
- Width and height must be specificed for all buttons (which actually adds some control for those with OCD like myself).
- All attributes must be passed through via URL parameters.
- CSS and javascript are all included in the same HTML file to reduce complexity and requests.
**Usage with SSL**
In order to avoid `insecure content` warnings when using GitHub Buttons on a page behind an SSL certificate, simply host a copy of the `github-btn.html` file on your secure directory and substitute your domain in the iframe include:
``` html
<iframe src="https://YOURDOMAIN.com/github-btn.html?user=USERNAME&repo=REPONAME&type=BUTTONTYPE"
allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe>
```
More refinement and functionalty is planned with open-sourcing--any help is always appreciated!
Bug tracker
-----------
Have a bug? Please create an issue here on GitHub at https://github.com/markdotto/github-buttons/issues.
Twitter account
---------------
Keep up to date on announcements and more by following Mark on Twitter, <a href="http://twitter.com/mdo">@mdo</a>.
Authors
-------
**Mark Otto**
+ http://twitter.com/mdo
+ http://github.com/markdotto
Copyright and license
---------------------
Copyright 2011 Mark Otto.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or 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.

View file

@ -1,45 +0,0 @@
html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
table{border-collapse:collapse;border-spacing:0;}
ol,ul{list-style:none;}
q:before,q:after,blockquote:before,blockquote:after{content:"";}
html{overflow-y:scroll;font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
a:focus{outline:thin dotted;}
a:hover,a:active{outline:0;}
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
audio:not([controls]){display:none;}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
sup{top:-0.5em;}
sub{bottom:-0.25em;}
img{border:0;-ms-interpolation-mode:bicubic;}
button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
button,input{line-height:normal;*overflow:visible;}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
textarea{overflow:auto;vertical-align:top;}
body{background-color:#ffffff;margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#404040;}
.container{width:940px;margin-left:auto;margin-right:auto;zoom:1;}.container:before,.container:after{display:table;content:"";zoom:1;*display:inline;}
.container:after{clear:both;}
a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a:hover{color:#00438a;text-decoration:underline;}
p{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;}
h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;}
h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;}
h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;}
h3{line-height:27px;font-size:18px;}h3 small{font-size:14px;}
h4{font-size:16px;line-height:36px;}h4 small{font-size:12px;}
h5{font-size:14px;line-height:18px;}
h6{font-size:13px;line-height:18px;color:#bfbfbf;text-transform:uppercase;}
ul,ol{margin:0 0 9px 25px;}
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
ul{list-style:disc;}
ol{list-style:decimal;}
li{line-height:18px;color:#404040;}
hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;}
strong{font-style:inherit;font-weight:bold;}
em{font-style:italic;font-weight:inherit;line-height:inherit;}
.muted{color:#bfbfbf;}
abbr{font-size:90%;text-transform:uppercase;border-bottom:1px dotted #ddd;cursor:help;}
@media (max-width: 480px){.container{width:auto;padding:0 15px;}}@media (min-width: 480px) and (max-width: 768px){.container{width:auto;padding:0 10px;}}

File diff suppressed because one or more lines are too long

View file

@ -1,76 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The Unofficial GitHub Watch &amp; Fork Buttons</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Mark Otto">
<meta name="description" content="A set of static buttons with dynamic watch and fork counts for any repo hosted on GitHub.">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="bootstrap.min.css" rel="stylesheet">
<link href="page.css" rel="stylesheet">
</head>
<body>
<div class="container">
<header class="masthead">
<div class="tweet-button">
<a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-via="mdo">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
</div>
<p class="introducing">Introducing the unofficial</p>
<h1>GitHub Buttons</h1>
<p class="tagline">Showcase your GitHub repo's success with these three simple, static buttons featuring dynamic watch, fork, and follower counts.</p>
</header>
<section class="body">
<div class="about-buttons clearfix">
<div class="about-star">
<h2>Star</h2>
<iframe src="github-btn.html?user=twitter&repo=bootstrap&type=watch&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="152px" height="30px"></iframe>
<ul class="downlow">
<li>Real-time stars count</li>
<li>Link to any public GitHub repo</li>
<li>Two available sizes</li>
</ul>
</div>
<div class="about-fork">
<h2>Fork</h2>
<iframe src="github-btn.html?user=twitter&repo=bootstrap&type=fork&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="146px" height="30px"></iframe>
<ul class="downlow">
<li>Real-time forks count</li>
<li>Link to any public GitHub repo</li>
<li>Two available sizes</li>
</ul>
</div>
<div class="about-follow">
<h2>Follow</h2>
<iframe src="github-btn.html?user=markdotto&type=follow&count=true&size=large" allowtransparency="true" frameborder="0" scrolling="0" width="246px" height="30px"></iframe>
<ul class="downlow">
<li>Real-time followers count</li>
<li>Link to any public GitHub user</li>
<li>Two available sizes</li>
</ul>
</div>
</div>
<p class="download">
<a href="http://github.com/markdotto/github-buttons" class="primary btn">Download on GitHub</a>
</p>
</section>
<footer class="footer">
<p>
<iframe src="github-btn.html?user=markdotto&repo=github-buttons&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="85px" height="20px"></iframe>
<iframe src="github-btn.html?user=markdotto&repo=github-buttons&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95px" height="20px"></iframe>
</p>
<p>Designed and built by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> with help from <a href="https://github.com/markdotto/github-buttons/graphs/contributors" target="_blank">the contributors</a>.</p>
<p>Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>.</p>
</footer>
</div>
</body>
</html>

View file

@ -1,212 +0,0 @@
/* DOCS RESET
-------------------------------------------------- */
body {
padding: 40px 20px;
color: #555;
text-shadow: 0 1px 0 #fff;
background-color: #fff;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eee), color-stop(25%, #fff), to(#fff));
background-image: -webkit-linear-gradient(#eee, #fff 25%, #fff);
background-image: -moz-linear-gradient(top, #eee, #fff 25%, #fff);
background-image: -ms-linear-gradient(#eee, #fff 25%, #fff);
background-image: -o-linear-gradient(#eee, #fff 25%, #fff);
background-image: linear-gradient(#eee, #fff 25%, #fff);
background-repeat: no-repeat;
background-attachment: fixed;
overflow: auto;
}
body,
p,
li {
font-size: 14px;
line-height: 20px;
}
h1, h2, h3, h4, h5, h6 {
text-rendering: optimizeLegibility;
}
/* Set width of site */
.container {
width: auto;
max-width: 820px;
}
/* Clearfix */
.clearfix:before,
.clearfix:after {
content:"";
display:table;
}
.clearfix:after {
clear:both;
}
/* Change up the buttons to match GitHub */
.primary.btn {
color: #fff;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0,0,0,.5);
background-color: #3072b3; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
background-image: -moz-linear-gradient(top, #599bdc 0%, #3072b3 100%); /* FF3.6+ */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#599bdc), color-stop(100%,#3072b3)); /* Chrome,Safari4+ */
background-image: -webkit-linear-gradient(top, #599bdc 0%,#3072b3 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -ms-linear-gradient(top, #599bdc 0%,#3072b3 100%); /* IE10+ */
background-image: -o-linear-gradient(top, #599bdc 0%,#3072b3 100%); /* Opera 11.10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#599bdc', endColorstr='#3072b3',GradientType=0 ); /* IE6-9 */
background-image: linear-gradient(top, #599bdc 0%,#3072b3 100%); /* W3C */
border: 1px solid #2967a4;
-webkit-transition: none;
-moz-transition: none;
transition: none;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.2);
box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.2);
}
.primary.btn:hover {
background-position: 0 -15px;
}
.primary.btn:active {
background-image: none;
background-color: #3072b3; /* Old browsers */
-webkit-box-shadow: inset 0 5px 10px rgba(0,0,0,.125), 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 5px 10px rgba(0,0,0,.125), 0 1px 2px rgba(0,0,0,.2);
box-shadow: inset 0 5px 10px rgba(0,0,0,.125), 0 1px 2px rgba(0,0,0,.2);
}
/* MASTHEAD
-------------------------------------------------- */
.masthead {
margin-bottom: 30px;
}
.masthead h1,
.masthead p {
text-align: center;
}
.masthead h1 {
margin-bottom: 10px;
font-size: 80px;
line-height: 1;
}
.masthead p {
font-size: 18px;
line-height: 30px;
}
.masthead .introducing {
margin-bottom: 20px;
color: #999;
}
.masthead .tagline {
margin-bottom: 30px;
font-size: 24px;
}
.masthead .tweet-button {
width: 55px;
margin: 0 auto 20px;
}
/* BODY
-------------------------------------------------- */
/* Two-column buttons */
.about-buttons {
text-align: center;
}
.about-star,
.about-fork,
.about-follow {
width: 32%;
float: left;
}
.about-buttons div + div {
margin-left: 2%;
}
.about-buttons ul {
margin-left: 0;
list-style: none;
}
.about-buttons iframe {
margin: 10px 0;
}
/* Download button */
.download {
margin: 30px 0 50px;
text-align: center;
}
.download .btn {
font-size: 20px;
padding: 12px 24px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
/* FOOTER
-------------------------------------------------- */
.footer {
margin-top: 40px;
padding: 0;
border-top: 0;
}
.footer p {
text-align: center;
}
iframe + iframe {
margin-left: 10px;
}
/* MISC
-------------------------------------------------- */
/* Small lines after each section */
.masthead:after,
.body:after {
display: block;
content: '';
width: 100px;
height: 1px;
margin: 0 auto;
background-color: #eee;
}
/* RESPONSIVE
-------------------------------------------------- */
@media (max-width: 840px) {
.masthead h1 {
font-size: 60px;
}
.masthead p,
.masthead .tagline {
font-size: 18px;
line-height: 24px;
}
.about-watch,
.about-fork,
.about-follow {
width: auto;
float: none;
margin-bottom: 20px;
}
.about-buttons div + div {
margin-left: 0;
}
}
@media (max-width: 480px) {
.masthead h1 {
font-size: 40px;
}
.masthead p,
.masthead .tagline {
font-size: 16px;
line-height: 20px;
}
}

View file

@ -0,0 +1 @@
google-site-verification: googlef3b1402b0e28338a.html

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 395 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,023 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show more