Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="row-fluid mscom-header-row-1" data-view4="2" data-view3="2" data-view2="2" data-view1="2" data-cols="2">
<div class="span bp1-col-2-1 bp2-col-2-1 bp3-col-2-1 bp0-col-2-1 mscom-header-section-1-1">
<a target="_self" class="mscom-link mscom-siteLogo mscom-siteLogo-small" title="Microsoft" href="http://www.microsoft.com" >
<img
<img
src="//c.s-microsoft.com/en-us/CMSImages/mslogo.png?version=856673f8-e6be-0476-6669-d5bf2300391d"
class="mscom-image mscom-left" alt="Microsoft" width="160" height="34">
</a>
Expand Down Expand Up @@ -148,9 +148,9 @@
<a class="right carousel-control" href="#carousel-featured-repos" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
</div>

<div class="all-projects">
<h3 ng-cloak>{{resultsSectionTitle}}</h3>
<div class="loading" ng-hide="main.projects">Loading data...</div>
Expand Down Expand Up @@ -184,7 +184,7 @@ <h3 ng-cloak>{{resultsSectionTitle}}</h3>
</div>
</div>
</div>

<div class="organizations">
<h3 class="orgs-heading">Other Microsoft GitHub Organizations</h3>
<div class="row">
Expand All @@ -193,7 +193,6 @@ <h3 class="orgs-heading">Other Microsoft GitHub Organizations</h3>
<!-- <img ng-src="{{org.image}}" alt="{{org.image}}"> -->
<span class="text-center" ng-cloak>{{org.title}}</span>
</a>

</div>
</div>
</div>
Expand Down Expand Up @@ -256,7 +255,7 @@ <h3 class="orgs-heading">Other Microsoft GitHub Organizations</h3>
</div>
</div>
</div>
</div>
</div>
<div class="span bp0-col-1-1 bp1-col-2-1 bp3-col-4-1 bp1-clear bp2-col-2-1 bp2-clear mscom-footer-destinationlink">
<div>
<div class="CSPvNext ">
Expand Down Expand Up @@ -322,14 +321,14 @@ <h3 class="orgs-heading">Other Microsoft GitHub Organizations</h3>
<div class="span bp0-col-1-1 bp1-col-1-1 bp2-col-1-1 bp3-col-1-1 mscom-footer-defaultlink">
<div class="container">
<div class="row">
<div class="credits">This open sourced site is <a href="https://github.com/Microsoft/microsoft.github.io" target="_blank">hosted on GitHub</a>. Patches, suggestions and comments are welcome.
<div class="credits">This open sourced site is <a href="https://github.com/Microsoft/microsoft.github.io" target="_blank">hosted on GitHub</a>. Patches, suggestions and comments are welcome.
Built with love... and <a href="http://angularjs.org/" target="_blank">AngularJS</a>, <a href="http://getbootstrap.com/" target="_blank">Bootstrap</a>, <a href="http://pages.github.com/" target="_blank">GitHub Pages</a>, and <a href="http://developer.github.com/v3/" target="_blank">API</a>.</div>
</div>
</div>
</div>
</div>
</div>

<div class="CSPvNext CMSvNextComp mscom-footer mscom-footer2" >
<div class="row-fluid mscom-footer-row-3 mscom-container-maxwidth mscom-grid-container mscom-grid-container"
data-cols="1" data-view1="1" data-view2="1" data-view3="1" data-view4="1">
Expand All @@ -352,7 +351,6 @@ <h3 class="orgs-heading">Other Microsoft GitHub Organizations</h3>
<img src="img/MSOpenTech_logo.png" />
</a>
</div>

</div>

</div>
Expand All @@ -364,41 +362,38 @@ <h3 class="orgs-heading">Other Microsoft GitHub Organizations</h3>
</div>
<div class="list2" style="text-align: right;">
<ul style="list-style-type: none;">
<li style="margin-right:20px;">
<li>
<a class="mscom-link"
href="http://go.microsoft.com/fwlink/?LinkId=248681" target="_self">Privacy &amp; cookies</a>
</li>
<li style="margin-left:25px;">
<li>
<a class="mscom-link"
href="~/TOU" target="_self">Terms of use</a>
</li>
<li>
<a class="mscom-link"
href="http://go.microsoft.com/?linkid=9851308" target="_self">Trademarks</a>
</li>
<li style="margin-left:25px;">&copy; 2014 Microsoft</li>
<li>&copy; 2014 Microsoft</li>
</ul>
</div>

</div>

</div>
</div>
</div>
</div>
</div>
</div>

</div>
</div>
</div>
</footer>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular-aria.min.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.2.0.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.2.0.js"></script>
<script src="js/main.js"></script>
<script type="text/JavaScript">
var varSegmentation = 0;
Expand Down
29 changes: 14 additions & 15 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ app.factory('Backend', ['$http',
return $http.get(url).then(function(resp) {
return resp.data;
});
}
};
};

return {
featured: get('data/featured.json'),
orgs: get('data/organization.json')
}
};
}
])
.controller('MainCtrl', ['Backend', '$scope', 'filterFilter',
.controller('MainCtrl', ['Backend', '$scope', 'filterFilter',
function(Backend, $scope, filterFilter) {
var self = this;

Backend.orgs().then(function(data) {
self.orgs = data;
});

Backend.featured().then(function(data) {
self.featured = data;

$.ajax({
url: 'https://popularrepostg.blob.core.windows.net/popularrepos/projects.json',
dataType: 'jsonp',
jsonpCallback: 'JSON_CALLBACK',
success: function(data) {
success: function(data) {
var projects = data[0].AllProjects;
$scope.currentPage = 1; //current page
$scope.maxSize = 5; //pagination max size
Expand All @@ -41,17 +41,17 @@ app.factory('Backend', ['$http',
$scope.noOfRepos = projects.length;
$scope.noOfPages = Math.ceil($scope.noOfRepos / $scope.entryLimit);
$scope.resultsSectionTitle = 'All Repos';

$scope.$watch('searchText', function(term) {
// Create $scope.filtered and then calculate $scope.noOfPages, no racing!
$scope.filtered = filterFilter(projects, term);
$scope.noOfRepos = $scope.filtered.length;
$scope.noOfPages = Math.ceil($scope.noOfRepos / $scope.entryLimit);
$scope.resultsSectionTitle = (!term) ? 'All Repos' : (($scope.noOfRepos == 0) ? 'Search results' : ($scope.noOfRepos + ' repositories found'));
$scope.resultsSectionTitle = (!term) ? 'All Repos' : (($scope.noOfRepos === 0) ? 'Search results' : ($scope.noOfRepos + ' repositories found'));
});

var featuredProjects = new Array();

self.featured.forEach(function (name) {
for (var i = 0; i < projects.length; i++) {
var project = projects[i];
Expand All @@ -61,7 +61,7 @@ app.factory('Backend', ['$http',
}
}
});

self.projects = projects;
self.featuredProjects = featuredProjects;
$scope.$apply();
Expand All @@ -72,11 +72,11 @@ app.factory('Backend', ['$http',
dataType: 'jsonp',
jsonpCallback: 'JSON_CALLBACK',
success: function (stats) {
if (stats != null) {
if (stats !== null) {
$scope.overAllStats = stats[0];
}
}
})
});
});
}
])
Expand All @@ -87,6 +87,5 @@ app.factory('Backend', ['$http',
return input.slice(start);
}
return [];
}
};
});