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
2 changes: 1 addition & 1 deletion data/featured.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"textHeader": [
"<h3>Adobe Research</h3>",
"<p class='details'>Open-source published code from cutting-edge research at Adobe.<br/>",
"<a href='http://www.adobe.com/open-source.html' target='_blank'>Learn more...</a>"
"<a href='https://www.adobe.com/open-source.html' target='_blank'>Learn more...</a>"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions data/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"pushed_at":"2014-11-27T17:50:54Z",
"html_url":"https://github.com/adobe/brackets-edge-web-fonts",
"languages_url":"https://api.github.com/repos/adobe/brackets-edge-web-fonts/languages",
"homepage":"http://html.adobe.com/edge/webfonts/",
"homepage":"https://edgewebfonts.adobe.com/",
"languagesTotal":82895
},
{
Expand Down Expand Up @@ -2709,7 +2709,7 @@
"pushed_at":"2014-08-27T20:37:52Z",
"html_url":"https://github.com/adobe-fonts/source-code-pro",
"languages_url":"https://api.github.com/repos/adobe-fonts/source-code-pro/languages",
"homepage":"http://adobe-fonts.github.io/source-code-pro/",
"homepage":"https://adobe-fonts.github.io/source-code-pro/",
"languagesTotal":454
},
{
Expand Down Expand Up @@ -5488,4 +5488,4 @@
}
]
}
]
]
74 changes: 37 additions & 37 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.factory("FeaturedHeader", function($resource) {
this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline, FeaturedHeader) {

//------------------------------- Init --------------------------------

//Be able to call math functions
$scope.Math = Math;
$scope.Object = Object;
Expand All @@ -44,17 +44,17 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
};
$scope.searchLang = [];
$scope.searchOrg = [];

//Init display range
$scope.projFirst = 0;
$scope.projLast = 10;

//Loading active
$scope.loading = true;


//------------------------------- Featured header --------------------------------

// hFeatured on the header
$scope.featureds = FeaturedHeader.query(function() {
$scope.featureds = $scope.featureds[0];
Expand All @@ -68,7 +68,7 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
}
}
});

$scope.changeIndexFeatured = function(i, delta) {
if ($scope.indexFeatured[i] <= 0 && delta < 0) {
$scope.indexFeatured[i] = $scope.featureds[i].length - 1;
Expand All @@ -78,11 +78,11 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
$scope.indexFeatured[i] += delta;
}
};

$scope.setIndexFeatured = function(i, index) {
$scope.indexFeatured[i] = index;
};

//------------------------------- Datas --------------------------------

$scope.projects = [];
Expand All @@ -99,10 +99,10 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
console.error("ERROR: Server error.\n", error);
$scope.loadOffline();
});

$scope.loadOffline = function() {
//TODO: display message in front

DatasAdobeOffline.query(function(rep) {
if (rep[0]) {
$scope.updateData(rep[0]);
Expand All @@ -113,13 +113,13 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
console.error("ERROR: Impossible to load the data. Please reload.");
});
};

$scope.updateData = function(data) {
$scope.projects = data.repos;
$scope.orgs = data.orgs;
$scope.langs = data.langs;
$scope.stats = data.stats;

$("#searchLang").autocomplete({
source: $scope.objToNamedArray($scope.langs),
select: function(e, q) {
Expand All @@ -131,7 +131,7 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
return false;
}
});

$("#searchOrg").autocomplete({
source: $scope.objToNamedArray($scope.orgs),
select: function(e, q) {
Expand All @@ -143,17 +143,17 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
return false;
}
});

$scope.updateGraph();

//Loading over
$scope.loading = false;
};

$scope.updateGraph = function() {
// Filtering langs for only major ones
var majorLangs = $scope.filter('majorLangs')($scope.langs, $scope.stats.bitesLangCode);

//Initiate graphs
// var langChart = dc.pieChart("#langChart");
var langChart = dc.rowChart("#langChart");
Expand Down Expand Up @@ -198,37 +198,37 @@ this.GitHubCtrl = function($scope, $sce, $filter, DatasAdobe, DatasAdobeOffline,
};

//------------------------------- Filters --------------------------------

$scope.majDisplayStar = function(index) { $scope.displayStarIndex = index; };
$scope.majFilterStar = function(index) { $scope.filterStarIndex = index; };

$scope.addFilter = function(filter, item) {
var present = false;

for (var i = 0; i < filter.length; i++) {
if (filter[i] == item) {
present = true;
}
}

if (!present) {
filter.push(item);
}
};

$scope.deleteFilter = function(array, i) {
array.splice(i, 1);
};

$scope.closeHelp = function() {
$scope.helped = true;
};

$scope.toggleFiltersButton = function() {
$scope.closeHelp();
$scope.toggleFilters = !$scope.toggleFilters;
};

//--------------------------- Mobile & Parrallax -----------------------------

$scope.mobile = isMobile(navigator.userAgent||navigator.vendor||window.opera);
Expand Down Expand Up @@ -264,7 +264,7 @@ bases.eq(active_index).addClass("active");
var showMore = false;
var scrollUpdate = function() {
var scrollTop = $(window).scrollTop();

var index = 0;
//Looping over the differents anchors
while (index + 1 !== anchors.length) {
Expand All @@ -287,29 +287,29 @@ var scrollUpdate = function() {
var topLogo_header = ( $(window).scrollTop() * 1.5 ) - 180;
$("#featuredProj .logo").css({ top: topLogo_header });
}

// ----------------------------------------------------------------------------
// 2nd parrallax: organisations
var topLogo_org = ( ( $(window).scrollTop() - $("#featuredOrg").position().top + 350 ) / 2 ) - 10 ;
if (topLogo_org > 90)
topLogo_org = 90;
$("#featuredOrg .logo").css({ top: topLogo_org });

// ----------------------------------------------------------------------------
// 3rd parrallax: footer
var bottomScreen = scrollTop + $(window).height();
var footerBottom = $("#footer").position().top + $("#footer").height();
var topLogo_footer = Math.round(bottomScreen - footerBottom - $(".menu").height());
$("#logo3").css({ bottom: topLogo_footer });


// ----------------------------------------------------------------------------
// Show More/Less button
if (!showMore) {
$(".buttonMore").css({position: 'absolute', bottom: -50});
} else {
var bottomScreen = scrollTop + $(window).height();

if (bottomScreen > $("#featuredOrg").offset().top + 25) {
$(".buttonLess").css({position: 'absolute', bottom: -50});
} else {
Expand Down Expand Up @@ -417,7 +417,7 @@ app.filter('projectsFilter', function() {
return function(projects, scope) {
projects = scope.filter('filter')(scope.projects, scope.searchName);
var newProject = [];

if (scope.searchLang || scope.searchOrg || scope.filterStarIndex !== 0) {
for (var i = 0; i < projects.length; i++) {
var actProj = projects[i];
Expand Down Expand Up @@ -453,7 +453,7 @@ app.filter('projectsFilter', function() {
var regOrg = new RegExp(scope.searchOrg[k], "i");
resOrg = actProj.org.search(regOrg);
}

if ((resLang.length || scope.searchLang.length === 0) &&
(resOrg !== -1 || !scope.searchOrg) &&
filterStarBool) {
Expand All @@ -477,10 +477,10 @@ app.filter('majorLangs', function() {
"name": "Others",
"value": 0
};

for (var i = 0; i < langs.length; i++) {
var lang = langs[i];

if ( (lang.value / max) > 0.070 ) {
majorLangs.push(lang);
} else {
Expand All @@ -489,7 +489,7 @@ app.filter('majorLangs', function() {
}
majorLangs.sort(function(a,b) { return a.value - b.value; });
majorLangs.push(other);

return majorLangs;
};
});
Expand Down Expand Up @@ -581,7 +581,7 @@ app.filter('timeDiff', function() {
//Reduce it to the number of days not counted
days = days % 365;
}

var months = Math.floor( days / 30 );
if (months !== 0 ) {
sDate += months + " month";
Expand All @@ -592,9 +592,9 @@ app.filter('timeDiff', function() {
} else {
sDate += date_diff.getHours() + " h " + date_diff.getMinutes() + " min";
}

return sDate;
};
});

}
}