Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 9537eff6418a8057d25e33481f071f25ed3eb7d6 @Japh Japh committed Jan 9, 2012
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
+<cross-domain-policy>
+
+
+<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
+
+<!-- Least restrictive policy: -->
+ <site-control permitted-cross-domain-policies="all"/>
+ <allow-access-from domain="*" to-ports="*" secure="false"/>
+ <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
+<!--
+ If you host a crossdomain.xml file with allow-access-from domain="*"
+ and don’t understand all of the points described here, you probably
+ have a nasty security vulnerability. ~ simon willison
+-->
+
+</cross-domain-policy>
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<html dir="ltr" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>EnvatoWP | What we&#039;re up to with WordPress on GitHub</title>
+ <link rel="profile" href="http://gmpg.org/xfn/11" />
+ <link rel="stylesheet" type="text/css" href="/fonts/font.css">
+ <link rel="stylesheet" type="text/css" media="all" href="/style.css" />
+ <link href="/widget/widget.css" rel="stylesheet" type="text/css" media="screen" />
+ <link rel="shortcut icon" href="/favicon.ico"/>
+
+ <script type='text/javascript' src='/js/l10n.js?ver=20101110'></script>
+ <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.1.2'></script>
+ <script type="text/javascript" src="/js/github.api.js"></script>
+ <link rel='index' title='EnvatoWP' href='http://envatowp.github.com/' />
+
+ </head>
+
+ <body class="home blog">
+
+ <div id="content-wrap">
+
+ <div id="header">
+
+ <ul id="menu-primary-navigation" class="navigation">
+ <li id="menu-item-27" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-27"><a href="/">Home</a></li>
+ <li id="menu-item-25" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-25"><a href="/our-repositories.html">Our Repositories</a></li>
+ <li id="menu-item-26" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-26"><a href="/watched-repositories.html">Watched Repositories</a></li>
+ </ul>
+ <a href="http://envato.com" class="envato-leaf">Envato</a>
+
+ <a href="/" class="logo">EnvatoWP - What we're up to with WordPress on GitHub</a>
+
+ </div>
+ <div id="green-home">
+
+ <h1><a href="https://github.com/valendesigns/option-tree">OptionTree</a></h1>
+
+ <p>Our easy to use and completely free WordPress plugin that lets you add customizable theme options to your WordPress themes is on GitHub. <a href="https://github.com/valendesigns/option-tree">Watch It</a></p>
+
+ <img src="http://wp.envato.com/wp-content/themes/wp.envato/images/green-home-screwdriver.jpg" alt="" class="green-home-screwdriver" />
+
+ <div class="home-download">
+
+ <a href="http://wordpress.org/extend/plugins/option-tree/" rel="external nofollow" class="home-button">Download</a>
+
+ <span>Download v1.1.8.1 from <a href="http://wordpress.org" rel="external nofollow">WordPress.org</a></span>
+
+ </div>
+
+ </div>
+
+ <div id="content" role="main">
+
+ <div class="home-left">
+
+ <h2><span>&nbsp;</span>Our Repositories</h2>
+ <p>We want to help WordPress theme and plugin developers however we can, so here are some tools we created that will hopefully make your lives easier. Got improvements or suggestions? Let us know, or just fork it and submit a fix!<br /><a href="/our-repositories.html">View Our Repositories</a></p>
+
+ <h2><span class="watched">&nbsp;</span>Watched Repositories</h2>
+ <p class="no-pad">Here are some useful code snippets on GitHub that we're keeping our eyes on. Some are code snippets from articles on <a href="http://wp.tutsplus.com/">WP TutsPlus</a>. Got suggestions or improvements? Let the authors know! That's the beauty of social coding on GitHub.<br /><a href="/watched-repositories.html">View Watched Repositories</a></p>
+
+ </div>
+
+ <div class="home-right">
+
+ <h2>Latest EnvatoWP activity via GitHub</h2>
+
+ <div class="activity-cutoff-top"></div>
+
+ <ul class="activity">
+ <img class="loader" src="/images/loader-dark.gif" width="16" height="16" />
+ </ul>
+
+ <div class="activity-cutoff-bottom"></div>
+
+ </div>
+
+ </div><!-- #content -->
+
+
+ </div><!-- #content-wrap -->
+
+ <div id="footer-wrap">
+
+ <div id="footer">
+
+ <p>Pixel Icons by <a href="http://www.fatcow.com/free-icons/" rel="external nofollow">FatCow</a>, All trademarks are the property of their respective owners.</p>
+
+ <a href="http://github.com/EnvatoWP" rel="external nofollow" class="github-link">GitHub</a>
+
+ <a href="http://wordpress.org" rel="external nofollow" class="wp-link">WordPress</a>
+
+ <a href="http://envato.com" class="envato-link">Envato</a>
+
+ </div><!-- #footer -->
+
+ </div><!-- #footer-wrap -->
+
+ <script type="text/javascript" src="/widget/widget.js"></script>
+ <script type="text/javascript" src="/js/envatowp.github.js"></script>
+
+ </body>
+
+</html>
+
@@ -0,0 +1,221 @@
+$(function() {
+
+ $body = $('body');
+
+ if ( $body.hasClass( 'home' ) )
+ {
+ GitHubAPI.Activity( 'EnvatoWP', function ( json, status ) {
+ console.log( json );
+ if ( json.length > 0 )
+ {
+ var activity_count = 1;
+ var content = '';
+ $.each(json, function (i) {
+ eventCreated = this['created_at'];
+ eventActor = this['actor']['login'];
+ eventActorUrl = 'https://github.com/' + this['actor']['login'];
+ eventType = this['type'];
+ eventRepo = this['repo']['name'];
+ eventRepoUrl = this['repo']['url']
+ content += '<li id="activity-' + activity_count + '">';
+ activity_count++;
+ content += '<a href="' + eventActorUrl + '" rel="external nofollow">' + eventActor + '</a>';
+ switch ( eventType )
+ {
+ case 'GollumEvent':
+ gollumAction = this['payload']['pages'][0]['action'];
+ gollumPage = this['payload']['pages'][0]['page_name'];
+ gollumPageUrl = this['payload']['pages'][0]['html_url'];
+ content += ' ' + gollumAction + ' the page <a href="' + gollumPageUrl + '">' + gollumPage + '</a> ';
+ content += ' in the ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a> wiki';
+ break;
+
+ case 'GistEvent':
+ content += ' ' + this['payload']['action'] + 'd <a href="' + this['payload']['gist']['html_url'] + '">gist: ' + this['payload']['gist']['id'] + ' </a>';
+ break;
+
+ case 'FollowEvent':
+ content += ' started following ';
+ eventTarget = this['payload']['target']['login'];
+ eventTargetUrl = this['payload']['target']['html_url'];
+ content += '<a href="' + eventTargetUrl + '">' + eventTarget + '</a>';
+ break;
+
+ case 'ForkEvent':
+ content += ' forked ';
+ eventTarget = this['payload']['forkee']['name'];
+ eventTargetUrl = this['payload']['forkee']['html_url'];
+ content += '<a href="' + eventTargetUrl + '">' + eventTarget + '</a>';
+ break;
+
+ case 'WatchEvent':
+ content += ' started watching ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'CreateEvent':
+ content += ' created ' + this['payload']['ref_type'];
+ if ( this['payload']['ref'] !== null )
+ {
+ content += ' ' + this['payload']['ref'];
+ }
+ content += ' at ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'DeleteEvent':
+ content += ' deleted ' + this['payload']['ref_type'];
+ if ( this['payload']['ref'] !== null )
+ {
+ content += ' ' + this['payload']['ref'];
+ }
+ content += ' at ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'PushEvent':
+ var eventRef = this['payload']['ref'].split('/');
+ content += ' pushed to ' + eventRef[eventRef.length - 1] + ' at ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'PublicEvent':
+ content += ' open sourced ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'IssuesEvent':
+ content += ' ' + this['payload']['action'] + ' <a href="' + this['payload']['issue']['html_url'] + '">issue ' + this['payload']['issue']['number'] + '</a> on ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'IssueCommentEvent':
+ content += ' commented on <a href="' + this['payload']['issue']['html_url'] + '">issue ' + this['payload']['issue']['number'] + '</a> on ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'CommitCommentEvent':
+ content += ' commented on <a href="' + this['payload']['comment']['html_url'] + '">commit ' + this['payload']['comment']['id'] + '</a> on ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+
+ case 'PullRequestEvent':
+ content += ' ' + this['payload']['action'] + ' <a href="' + this['payload']['pull_request']['html_url'] + '">pull request ' + this['payload']['number'] + '</a> on ';
+ content += '<a href="' + eventRepoUrl + '">' + eventRepo + '</a>';
+ break;
+ }
+ var eventTime = new Date( eventCreated );
+ content += ' <time datetime="' + eventCreated + '" title="' + eventTime.toLocaleString() + '">' + time_ago( eventTime.getTime() / 1000 ) + '</time>';
+ content += '</li>';
+ });
+ content += '';
+ $('.activity').fadeOut('slow', function () {
+ $(this).html( content ).fadeIn('slow');
+ });
+ }
+ else
+ {
+ emptyResponse();
+ }
+ } );
+ }
+
+ if ( $body.hasClass( 'own' ) )
+ {
+ GitHubAPI.Repos( 'EnvatoWP', function ( json, status ) {
+ if ( json.length > 0 )
+ {
+ var content = '<ul id="own-list" style="display: none;">';
+ $.each(json, function (i) {
+ repoName = this['name'];
+ repoDescription = this['description'];
+ repoUrl = this['html_url'];
+ repoOwner = this['owner']['login'];
+ repoOwnerUrl = 'https://github.com/' + this['owner']['login'];
+ content += '<li>';
+ content += '<h3><a href="' + repoUrl + '" rel="external nofollow">' + repoName + '</a></h3>';
+ content += '<p>by <a href="' + repoOwnerUrl + '">' + repoOwner + '</a></p>';
+ if ( repoDescription !== '' )
+ {
+ content += '<p>' + repoDescription + '</p>';
+ }
+ content += '</li>';
+ });
+ content += '</ul>';
+ $('#content').html( content );
+ $('#own-list').slideDown('slow');
+ }
+ else
+ {
+ emptyResponse();
+ }
+ } );
+ }
+
+ if ( $body.hasClass( 'watched' ) )
+ {
+ GitHubAPI.Watched( 'EnvatoWP', function ( json, status ) {
+ if ( json.length > 0 )
+ {
+ var content = '<ul id="watched-list" style="display: none;">';
+ $.each(json, function (i) {
+ repoName = this['name'];
+ repoDescription = this['description'];
+ repoUrl = this['html_url'];
+ repoOwner = this['owner']['login'];
+ repoOwnerUrl = 'https://github.com/' + this['owner']['login'];
+ content += '<li>';
+ content += '<h3><a href="' + repoUrl + '" rel="external nofollow">' + repoName + '</a></h3>';
+ content += '<p>by <a href="' + repoOwnerUrl + '">' + repoOwner + '</a></p>';
+ if ( repoDescription !== '' )
+ {
+ content += '<p>' + repoDescription + '</p>';
+ }
+ content += '</li>';
+ });
+ content += '</ul>';
+ $('#content').html( content );
+ $('#watched-list').slideDown('slow');
+ }
+ else
+ {
+ emptyResponse();
+ }
+ } );
+ }
+
+});
+
+function emptyResponse()
+{
+ $('#content .loader').fadeOut('slow', function() {
+ $('#content').html( '<p style="display: none;">Oops! Sorry, there\s nothing to display here just yet, but there will be soon as we do more on GitHub.' );
+ $('#content p').fadeIn('slow');
+ });
+}
+
+function time_ago(time)
+{
+ periods = new Array("second", "minute", "hour", "day", "week", "month", "year", "decade");
+ lengths = new Array("60","60","24","7","4.35","12","10");
+
+ nowdate = new Date();
+ now = (nowdate.getTime() / 1000);
+
+ difference = now - time;
+ tense = "ago";
+
+ for(j = 0; difference >= lengths[j] && j < lengths.length-1; j++) {
+ difference /= lengths[j];
+ }
+
+ difference = Math.round(difference);
+
+ if(difference != 1) {
+ periods[j] += "s";
+ }
+
+ return difference + ' ' + periods[j] + ' ago';
+}
+
@@ -0,0 +1,24 @@
+function GitHubAPI(){}
+
+GitHubAPI.Repos = function ( username, callback ) {
+ requestURL = 'https://api.github.com/users/' + username + '/repos?callback=?';
+ $.getJSON( requestURL, function( json, status ) {
+ callback( json.data, status );
+ } );
+}
+
+GitHubAPI.Watched = function ( username, callback ) {
+ requestURL = 'https://api.github.com/users/' + username + '/watched?callback=?';
+ $.getJSON( requestURL, function( json, status ) {
+ callback( json.data, status );
+ } );
+}
+
+GitHubAPI.Activity = function ( username, callback ) {
+ requestURL = 'https://api.github.com/users/' + username + '/events/public?callback=?';
+ $.getJSON( requestURL, function( json, status ) {
+ console.log( json );
+ callback( json.data, status );
+ } );
+}
+

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 9537eff

Please sign in to comment.