Permalink
Browse files

Adding licenses and display in lightbox - GNU logos might have to be …

…redone though...
  • Loading branch information...
1 parent a7dcb78 commit f2038d840931fa50b0181f42b7181182c6af8f6b @jhuet jhuet committed with Jan-Christoph Borchardt Dec 29, 2011
View
@@ -60,9 +60,10 @@ h2#favorites a:hover {color: #D9C540}
/* icon hover */
h2+ul li a:hover, h2+ul li a:focus, #locale a:hover, #locale a.selected,
+#project-details .license a:hover, #project-details .license a:focus,
#project-details .alternative-to a:hover, #project-details .alternative-to a:focus,
#project-details .similar-to a:hover, #project-details .similar-to a:focus, #searching { background:rgba(30, 30, 30, 0.7); border-radius:.5em; box-shadow:#444 0 1px 0; }
-h2+ul li a:active, #project-details .alternative-to a:active, #project-details .similar-to a:active { background-color:#111; }
+h2+ul li a:active, #project-details .alternative-to a:active, #project-details .similar-to a:active, #project-details .license a:active { background-color:#111; }
/* text appearance */
li a span { display:none; }
li a:hover span, li a:focus span { position:absolute; display:inline; margin:30px 0 0 -82px; }
@@ -87,9 +88,11 @@ h3+p, h3+p+p, h3+p+p+p { color:#777; }
#project-details .details { clear: both; }
#project-details .introduction { font-size: 0.8em; line-height: 1.3em; }
#project-details .alternative-to a,
-#project-details .similar-to a { padding: 12px 7px 15px 7px; }
+#project-details .similar-to a,
+#project-details .license a{ padding: 12px 7px 15px 7px; }
#project-details .alternative-to img,
-#project-details .similar-to img { width: 35px; height: 35px; }
+#project-details .similar-to img,
+#project-details .license img{ width: 35px; height: 35px; }
#project-details .tip {
display: none;
View
@@ -51,7 +51,7 @@ <h3 id="participate"><a href="#participate" class="translatable">Participate</a>
<p class="introduction translatable"></p>
<div class="similar-to"><p class="translatable label">Similar to</p><ul></ul></div>
<div class="alternative-to"><p class="translatable label">Alternative to</p><ul></ul></div>
- <div class="license"></div>
+ <div class="license"><p class="translatable label">License</p><ul></ul></div>
</div>
<p class="tip translatable"></p>
</div>
View
@@ -1,6 +1,19 @@
var lp = {
"locales":[{"id":"de","name":"german"},{"id":"en","name":"english"},{"id":"fr","name":"french"},{"id":"id","name":"indonesian"},{"id":"it","name":"italian"}],
"categories":[{"id":"social","position":"1"},{"id":"tools","position":"2"},{"id":"news","position":"3"},{"id":"travel","position":"4"},{"id":"games","position":"5"},{"id":"multiplayer","position":"6"},{"id":"knowledge","position":"7"},{"id":"text","position":"8"},{"id":"audio","position":"9"},{"id":"video","position":"10"},{"id":"graphics","position":"11"},{"id":"publishing","position":"12"},{"id":"development","position":"13"},{"id":"science","position":"14"},{"id":"organization","position":"15"}],
+ "licenses":[
+ {"id":"cc-by-v25","name":"Creative Commons Attribution 2.5 Generic","url":"https://creativecommons.org/licenses/by/2.5/"},
+ {"id":"cc-by-nc-v3","name":"Creative Commons Attribution-NonCommercial 3.0 Unported","url":"https://creativecommons.org/licenses/by-nc/3.0/"},
+ {"id":"cc-by-nc-sa-v3","name":"Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported","url":"https://creativecommons.org/licenses/by-nc-sa/3.0/"},
+ {"id":"cc-by-nc-nd-v3","name":"Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported","url":"https://creativecommons.org/licenses/by-nc-nd/3.0/"},
+ {"id":"cc-by-sa-v3","name":"Creative Commons Attribution-ShareAlike 3.0 Unported","url":"https://creativecommons.org/licenses/by-nc/3.0/"},
+ {"id":"cc-by-nd-v3","name":"Creative Commons Attribution-NoDerivs 3.0 Unported","url":"https://creativecommons.org/licenses/by-nd/3.0/"},
+ {"id":"cc-zero-v1","name":"Creative Commons Public Domain Dedication","url":"https://creativecommons.org/publicdomain/zero/1.0/"},
+ {"id":"mit","name":"MIT license","url":"http://www.opensource.org/licenses/MIT"},
+ {"id":"gnu-agpl-v3","name":"GNU Affero General Public License","url":"https://www.gnu.org/licenses/agpl-3.0.html"},
+ {"id":"gnu-gpl-v3","name":"GNU General Public License","url":"https://www.gnu.org/licenses/gpl-3.0.html"},
+ {"id":"gnu-lgpl-v3","name":"GNU Lesser General Public License","url":"https://www.gnu.org/licenses/lgpl-3.0.html"},
+ ],
"alternatives":[
{"id":"gmail","name":"Gmail","url":"https:\/\/mail.google.com\/"},
{"id":"facebook","name":"Facebook","url":"https:\/\/www.facebook.com\/"},
@@ -17,8 +30,8 @@ var lp = {
{"id":"gtalk","name":"Gtalk","url":"https:\/\/www.google.com\/talk\/"}
],
"projects":[
- {"id":"diaspora","category":"social","name":"Diaspora","description":"social network","url":"http:\/\/diasp.eu\/","tags":["social","network","decentralized"],"alternative":["facebook","google plus"],"introduction":"Diaspora is a free personal web server that implements a distributed social networking service. Installations of the software form nodes (termed 'pods') which make up the distributed Diaspora social network."},
- {"id":"identica","category":"social","name":"Identi.ca","description":"microblog","url":"http:\/\/identi.ca\/","tags":["social","network","decentralized", "microblog"],"alternative":["twitter"]},
+ {"id":"diaspora","category":"social","name":"Diaspora","description":"social network","url":"http:\/\/diasp.eu\/","licenses":["gnu-agpl-v3"],"tags":["social","network","decentralized"],"alternative":["facebook","google plus"],"introduction":"Diaspora is a free personal web server that implements a distributed social networking service. Installations of the software form nodes (termed 'pods') which make up the distributed Diaspora social network."},
+ {"id":"identica","category":"social","name":"Identi.ca","description":"microblog","url":"http:\/\/identi.ca\/","licenses":["gnu-agpl-v3"],"tags":["social","network","decentralized", "microblog"],"alternative":["twitter"]},
{"id":"jappix","category":"social","name":"Jappix","description":"chat","url":"http:\/\/jappix.com\/","tags":["chat","jabber"],"alternative":["gtalk"]},
{"id":"freelishus","category":"social","name":"Freelish.us","description":"bookmarks","url":"http:\/\/freelish.us\/","tags":["bookmark","social"],"alternative":["delicious","diigo"]},
{"id":"reddit","category":"social","name":"Reddit","description":"discussion","url":"http:\/\/reddit.com\/"},
@@ -160,7 +173,7 @@ var lp = {
{"id":"scalablevg","category":"graphics","name":"scalable.vg","description":"hosting","url":"http:\/\/scalable.vg\/"},
{"id":"mirocommunity","category":"video","name":"Miro Community","description":"platform","url":"http:\/\/mirocommunity.org\/"},
{"id":"openhatch","category":"organization","name":"OpenHatch","description":"help platform","url":"http:\/\/openhatch.org\/"},
- {"id":"friendica","category":"social","name":"Friendica","description":"social multi network","url":"http:\/\/friendica.com\/","tags":["social","network","decentralized","microblog"],"alternative":["facebook","google plus","twitter"]}
+ {"id":"friendica","category":"social","name":"Friendica","description":"social multi network","url":"http:\/\/friendica.com\/","licenses":["mit"],"tags":["social","network","decentralized","microblog"],"alternative":["facebook","google plus","twitter"]}
]
};
View
@@ -19,26 +19,29 @@ lp = $.extend(lp, {
*/
actualProject: null,
- getProject: function(id) {
+ getData: function(type, id) {
var found = null;
- $.each(lp.projects, function(idxp, project) {
- if (project.id == id) {
- found = project;
- return false;
- }
- } );
+ if (typeof lp[type] != 'undefined') {
+ $.each(lp[type], function(idx, value) {
+ if (value.id == id) {
+ found = value;
+ return false;
+ }
+ } );
+ }
return found;
},
+ getProject: function(id) {
+ return lp.getData('projects', id);
+ },
+
getAlternative: function(id) {
- var found = null;
- $.each(lp.alternatives, function(idxp, alternative) {
- if (alternative.id == id) {
- found = alternative;
- return false;
- }
- } );
- return found;
+ return lp.getData('alternatives', id);
+ },
+
+ getLicense: function(id) {
+ return lp.getData('licenses', id);
},
findSimilarProjectsTo: function(project, max) {
@@ -315,13 +318,15 @@ lp = $.extend(lp, {
$details.find('.description').html(lp.actualProject.description);
$details.find('.category').attr('href', '#' + lp.actualProject.category).html(lp.actualProject.category).data('text', 'Check the ' + lp.actualProject.category + ' category');
$details.find('.logo').attr('src', 'logos/' + lp.actualProject.id + '.png');
+
var $tags = $details.find('.tags').html('');
if (lp.actualProject.tags && lp.actualProject.tags.length) {
$.each(lp.actualProject.tags, function(idxt, tag) {
$('<li />').html('#' + tag)
.appendTo($tags);
} );
}
+
var $alternative = $details.find('.alternative-to ul').html('');
if (lp.actualProject.alternative && lp.actualProject.alternative.length) {
$.each(lp.actualProject.alternative, function(idxa, alternative) {
@@ -334,6 +339,18 @@ lp = $.extend(lp, {
} );
}
+ var $license = $details.find('.license ul').html('');
+ if (lp.actualProject.licenses && lp.actualProject.licenses.length) {
+ $.each(lp.actualProject.licenses, function(idx, license) {
+ license = lp.getLicense(license);
+ if (license) {
+ var $li = $('<li />').html('<a href="' + license.url + '"><img src="logos/licenses/' + license.id + '.png" alt="' + license.name + ' logo"/></a>')
+ .appendTo($license);
+ $li.find('a').data('text', license.name);
+ }
+ } );
+ }
+
var $similar = $details.find('.similar-to ul').html('');
$.each(lp.findSimilarProjectsTo(), function(idxs, similar) {
var $li = $('<li />').html('<a href="#"><img src="logos/' + similar.id + '.png" alt="' + similar.name + ' logo"/></a>')
@@ -355,7 +372,8 @@ lp = $.extend(lp, {
if ($alternative.find('li').length == 0 ||
$similar.find('li').length == 0 ||
- $introduction.html().length == 0) {
+ $introduction.html().length == 0 ||
+ $license.find('li').length == 0) {
$details.find('.tip').html('This sheet is not complete <a href=\'#participate\'>help us</a> improve it.')
.data('translatable', 'This sheet is not complete <a href=\'#participate\'>help us</a> improve it.')
.show();
@@ -395,7 +413,7 @@ lp = $.extend(lp, {
$.modal.close();
},
minWidth: 450,
- minHeight: 300,
+ minHeight: 350,
closeHTML: 'X',
overlayClose: true
};
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.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f2038d8

Please sign in to comment.