Skip to content

Commit

Permalink
Octicons
Browse files Browse the repository at this point in the history
  • Loading branch information
azenla committed Sep 1, 2014
1 parent 557c91b commit 28cff46
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 240 deletions.
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<title>GitHub for Dart - Demos</title>
<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body>
Expand Down
3 changes: 2 additions & 1 deletion example/languages.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<link href="http://github.directcode.org/github-markdown.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-languages">
<div class="header">
<h1>Repository Languages</h1>

<div class="btn" id="view-source">View the Source</div>
<div class="btn" id="view-source"><span class="octicon octicon-file-code"></span> View the Source</div>
<p/>
</div>

Expand Down
3 changes: 2 additions & 1 deletion example/octocat.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-octocat">
<div class="header">
<div class="btn" id="view-source">View the Source</div>
<div class="btn" id="view-source"><span class="octicon octicon-file-code"></span> View the Source</div>
<p></p>
</div>

Expand Down
4 changes: 2 additions & 2 deletions example/organization.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-org">
<div class="header">
<h1>GitHub Organization</h1>
<div class="btn btn-primary" id="view-source">View the Source</div>
<p></p>
<div class="btn" id="view-source"><span class="octicon octicon-file-code"></span> View the Source</div>
</div>

<div id="org"></div>
Expand Down
3 changes: 2 additions & 1 deletion example/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<link href="http://github.directcode.org/github-markdown.css" rel="stylesheet">
<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-readme">
<div class="header">
<button id="view-source">View the Source</button>
<div class="btn" id="view-source"><span class="octicon octicon-file-code"></span> View the Source</div>
<p></p>
</div>

Expand Down
3 changes: 1 addition & 2 deletions example/releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<body>
<div class="demo-releases header">
<h1>GitHub Releases</h1>
<button id="view-source">View the Source</button>
<p></p>
<div class="btn" id="view-source"><span class="octicon octicon-code"></span> View the Source</div> <p></p>
</div>

<div id="releases"></div>
Expand Down
13 changes: 7 additions & 6 deletions example/repos.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-repos">
<div class="header">
<h2 id="title">GitHub for Dart - Repositories</h2>
<div class="btn btn-primary" id="view-source">View the Source</div>
<div class="btn btn-primary" id="reload">Reload</div>
<div class="btn btn-primary" id="sort-stars">Sort by Stars</div>
<div class="btn btn-primary" id="sort-forks">Sort by Forks</div>
<div class="btn btn-primary" id="sort-created">Sort by Creation Date</div>
<div class="btn btn-primary" id="sort-pushed">Sort by Last Push</div>
<div class="btn" id="view-source"><span class="octicon octicon-file-code"></span> View the Source</div>
<div class="btn btn-primary" id="reload"><span class="octicon octicon-sync"></span> Reload</div>
<div class="btn btn-primary" id="sort-stars"> <span class="octicon octicon-star"></span> Sort by Stars</div>
<div class="btn btn-primary" id="sort-forks"><span class="octicon octicon-repo-forked"></span> Sort by Forks</div>
<div class="btn btn-primary" id="sort-created"><span class="octicon octicon-plus"></span> Sort by Creation Date</div>
<div class="btn btn-primary" id="sort-pushed"><span class="octicon octicon-repo-push"></span> Sort by Last Push</div>
<p></p>
</div>

Expand Down
1 change: 1 addition & 0 deletions example/stars.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-stars">
Expand Down
1 change: 1 addition & 0 deletions example/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<link rel="stylesheet/less" type="text/css" href="styles/main.less" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/1.7.4/less.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.corsproxy.com/github.directcode.org/octicons/octicons.css">
</head>

<body class="demo-users">
Expand Down
1 change: 1 addition & 0 deletions example/view_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<div id="editor"></div>

<script src="http://github.directcode.org/ready.js"></script>
<script src="view_source.js"></script>
</body>

Expand Down
227 changes: 0 additions & 227 deletions example/view_source.js
Original file line number Diff line number Diff line change
@@ -1,230 +1,3 @@
var ready = (function(){

var readyList,
DOMContentLoaded,
class2type = {};
class2type["[object Boolean]"] = "boolean";
class2type["[object Number]"] = "number";
class2type["[object String]"] = "string";
class2type["[object Function]"] = "function";
class2type["[object Array]"] = "array";
class2type["[object Date]"] = "date";
class2type["[object RegExp]"] = "regexp";
class2type["[object Object]"] = "object";

var ReadyObj = {
// Is the DOM ready to be used? Set to true once it occurs.
isReady: false,
// A counter to track how many items to wait for before
// the ready event fires. See #6781
readyWait: 1,
// Hold (or release) the ready event
holdReady: function( hold ) {
if ( hold ) {
ReadyObj.readyWait++;
} else {
ReadyObj.ready( true );
}
},
// Handle when the DOM is ready
ready: function( wait ) {
// Either a released hold or an DOMready/load event and not yet ready
if ( (wait === true && !--ReadyObj.readyWait) || (wait !== true && !ReadyObj.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( ReadyObj.ready, 1 );
}

// Remember that the DOM is ready
ReadyObj.isReady = true;
// If a normal DOM Ready event fired, decrement, and wait if need be
if ( wait !== true && --ReadyObj.readyWait > 0 ) {
return;
}
// If there are functions bound, to execute
readyList.resolveWith( document, [ ReadyObj ] );

// Trigger any bound ready events
//if ( ReadyObj.fn.trigger ) {
// ReadyObj( document ).trigger( "ready" ).unbind( "ready" );
//}
}
},
bindReady: function() {
if ( readyList ) {
return;
}
readyList = ReadyObj._Deferred();

// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
return setTimeout( ReadyObj.ready, 1 );
}

// Mozilla, Opera and webkit nightlies currently support this event
if ( document.addEventListener ) {
// Use the handy event callback
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
// A fallback to window.onload, that will always work
window.addEventListener( "load", ReadyObj.ready, false );

// If IE event model is used
} else if ( document.attachEvent ) {
// ensure firing before onload,
// maybe late but safe also for iframes
document.attachEvent( "onreadystatechange", DOMContentLoaded );

// A fallback to window.onload, that will always work
window.attachEvent( "onload", ReadyObj.ready );

// If IE and not a frame
// continually check to see if the document is ready
var toplevel = false;

try {
toplevel = window.frameElement == null;
} catch(e) {}

if ( document.documentElement.doScroll && toplevel ) {
doScrollCheck();
}
}
},
_Deferred: function() {
var // callbacks list
callbacks = [],
// stored [ context , args ]
fired,
// to avoid firing when already doing so
firing,
// flag to know if the deferred has been cancelled
cancelled,
// the deferred itself
deferred = {

// done( f1, f2, ...)
done: function() {
if ( !cancelled ) {
var args = arguments,
i,
length,
elem,
type,
_fired;
if ( fired ) {
_fired = fired;
fired = 0;
}
for ( i = 0, length = args.length; i < length; i++ ) {
elem = args[ i ];
type = ReadyObj.type( elem );
if ( type === "array" ) {
deferred.done.apply( deferred, elem );
} else if ( type === "function" ) {
callbacks.push( elem );
}
}
if ( _fired ) {
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
}
}
return this;
},

// resolve with given context and args
resolveWith: function( context, args ) {
if ( !cancelled && !fired && !firing ) {
// make sure args are available (#8421)
args = args || [];
firing = 1;
try {
while( callbacks[ 0 ] ) {
callbacks.shift().apply( context, args );//shifts a callback, and applies it to document
}
}
finally {
fired = [ context, args ];
firing = 0;
}
}
return this;
},

// resolve with this as context and given arguments
resolve: function() {
deferred.resolveWith( this, arguments );
return this;
},

// Has this deferred been resolved?
isResolved: function() {
return !!( firing || fired );
},

// Cancel
cancel: function() {
cancelled = 1;
callbacks = [];
return this;
}
};

return deferred;
},
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ Object.prototype.toString.call(obj) ] || "object";
}
}
// The DOM ready check for Internet Explorer
function doScrollCheck() {
if ( ReadyObj.isReady ) {
return;
}

try {
// If IE is used, use the trick by Diego Perini
// http://javascript.nwbox.com/IEContentLoaded/
document.documentElement.doScroll("left");
} catch(e) {
setTimeout( doScrollCheck, 1 );
return;
}

// and execute any waiting functions
ReadyObj.ready();
}
// Cleanup functions for the document ready method
if ( document.addEventListener ) {
DOMContentLoaded = function() {
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
ReadyObj.ready();
};

} else if ( document.attachEvent ) {
DOMContentLoaded = function() {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( document.readyState === "complete" ) {
document.detachEvent( "onreadystatechange", DOMContentLoaded );
ReadyObj.ready();
}
};
}
function ready( fn ) {
// Attach the listeners
ReadyObj.bindReady();

var type = ReadyObj.type( fn );

// Add the callback
readyList.done( fn );//readyList is result of _Deferred()
}
return ready;
})();

var args = document.location.search.substring(1).split('&');

var opts = {};
Expand Down

0 comments on commit 28cff46

Please sign in to comment.