Colours, capitalization
This commit is contained in:
Родитель
2577b8cc67
Коммит
ac60921bea
|
@ -13,6 +13,7 @@ module.exports = function(grunt) {
|
|||
|
||||
// Transifex
|
||||
var TRANSIFEX_APP = 'webliteracymap';
|
||||
var SUPPORTED_LANGS = ['en_US', 'fr'];
|
||||
|
||||
// For JS processing
|
||||
var FUNCTION_NAME = 'WebLiteracyClient';
|
||||
|
@ -95,5 +96,5 @@ module.exports = function(grunt) {
|
|||
// MAIN GRUNT TASKS
|
||||
grunt.registerTask('generate', ['clean:dist', 'convert']);
|
||||
// grunt.registerTask('build', ['concat:basic']);
|
||||
grunt.registerTask('build', ['clean:locales', 'transifex', 'concat:basic', 'concat:withLocales']);
|
||||
grunt.registerTask('build', ['clean:locales', 'concat:basic', 'concat:withLocales']);
|
||||
};
|
||||
|
|
|
@ -54,6 +54,17 @@ function WebLiteracyClient(options) {
|
|||
return self.strings[tag + options.descriptionSuffix];
|
||||
};
|
||||
|
||||
self.color = function(tag) {
|
||||
var literacy = self.template.filter(function(item) {
|
||||
return item.tag === tag;
|
||||
})[0];
|
||||
if (literacy) {
|
||||
return literacy.color;
|
||||
}
|
||||
};
|
||||
// O Canada!
|
||||
self.colour = self.color;
|
||||
|
||||
self.all = function() {
|
||||
return self.template.map(function(item) {
|
||||
return {
|
||||
|
@ -73,91 +84,99 @@ WebLiteracyClient.prototype.template = [
|
|||
"term": "Navigation",
|
||||
"description": "Using software tools to browse the web",
|
||||
"tag": "weblit-Navigation",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff4e1f"
|
||||
},
|
||||
{
|
||||
"term": "Web Mechanics",
|
||||
"description": "Understanding the web ecosystem",
|
||||
"tag": "weblit-WebMechanics",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff6969"
|
||||
},
|
||||
{
|
||||
"term": "Search",
|
||||
"description": "Locating information, people and resources via the web",
|
||||
"tag": "weblit-Search",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#fe4040"
|
||||
},
|
||||
{
|
||||
"term": "Credibility",
|
||||
"description": "Critically evaluating information found on the web",
|
||||
"tag": "weblit-Credibility",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff5984"
|
||||
},
|
||||
{
|
||||
"term": "Security",
|
||||
"description": "Keeping systems, identities, and content safe",
|
||||
"tag": "weblit-Security",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff004e"
|
||||
},
|
||||
{
|
||||
"term": "Composing for the web",
|
||||
"description": "Creating and curating content for the web",
|
||||
"tag": "weblit-Composing",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#01bc85"
|
||||
},
|
||||
{
|
||||
"term": "Remixing",
|
||||
"description": "Modifying existing web resources to create something new",
|
||||
"tag": "weblit-Remix",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#00ceb8"
|
||||
},
|
||||
{
|
||||
"term": "Design and Accessibility",
|
||||
"description": "Creating universally effective communications through web resources",
|
||||
"tag": "weblit-DesignAccessibility",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#6ecba9"
|
||||
},
|
||||
{
|
||||
"term": "Coding/scripting",
|
||||
"description": "Creating interactive experiences on the web",
|
||||
"tag": "weblit-CodingScripting",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#00967f"
|
||||
},
|
||||
{
|
||||
"term": "Infrastructure",
|
||||
"description": "Understanding the Internet stack",
|
||||
"tag": "weblit-Infrastructure",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#09b773"
|
||||
},
|
||||
{
|
||||
"term": "Sharing and Collaborating",
|
||||
"description": "Jointly creating and providing access to web resources",
|
||||
"tag": "weblit-SharingCollaborating",
|
||||
"deprecates": []
|
||||
},
|
||||
{
|
||||
"term": "Collaborating",
|
||||
"description": "Creating web resources with others",
|
||||
"tag": "weblit-Collaborating",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#739ab1"
|
||||
},
|
||||
{
|
||||
"term": "Community Participation",
|
||||
"description": "Getting involved in web communities and understanding their practices",
|
||||
"tag": "weblit-Community",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#63cfea"
|
||||
},
|
||||
{
|
||||
"term": "Privacy",
|
||||
"description": "Examining the consequences of sharing data online",
|
||||
"tag": "weblit-Privacy",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#00bad6"
|
||||
},
|
||||
{
|
||||
"term": "Open Practices",
|
||||
"description": "Helping to keep the Web democratic and universally accessible",
|
||||
"tag": "weblit-OpenPractices",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#0097d6"
|
||||
}
|
||||
];
|
||||
WebLiteracyClient.prototype.langs["en"] = {
|
||||
|
@ -185,8 +204,6 @@ WebLiteracyClient.prototype.langs["en"] = {
|
|||
"weblit-Infrastructure_desc": "Understanding the Internet stack",
|
||||
"weblit-SharingCollaborating": "Sharing and Collaborating",
|
||||
"weblit-SharingCollaborating_desc": "Jointly creating and providing access to web resources",
|
||||
"weblit-Collaborating": "Collaborating",
|
||||
"weblit-Collaborating_desc": "Creating web resources with others",
|
||||
"weblit-Community": "Community Participation",
|
||||
"weblit-Community_desc": "Getting involved in web communities and understanding their practices",
|
||||
"weblit-Privacy": "Privacy",
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -23,8 +23,6 @@
|
|||
"weblit-Infrastructure_desc": "Understanding the Internet stack",
|
||||
"weblit-SharingCollaborating": "Sharing and Collaborating",
|
||||
"weblit-SharingCollaborating_desc": "Jointly creating and providing access to web resources",
|
||||
"weblit-Collaborating": "Collaborating",
|
||||
"weblit-Collaborating_desc": "Creating web resources with others",
|
||||
"weblit-Community": "Community Participation",
|
||||
"weblit-Community_desc": "Getting involved in web communities and understanding their practices",
|
||||
"weblit-Privacy": "Privacy",
|
||||
|
|
|
@ -39,6 +39,17 @@ function WebLiteracyClient(options) {
|
|||
return self.strings[tag + options.descriptionSuffix];
|
||||
};
|
||||
|
||||
self.color = function(tag) {
|
||||
var literacy = self.template.filter(function(item) {
|
||||
return item.tag === tag;
|
||||
})[0];
|
||||
if (literacy) {
|
||||
return literacy.color;
|
||||
}
|
||||
};
|
||||
// O Canada!
|
||||
self.colour = self.color;
|
||||
|
||||
self.all = function() {
|
||||
return self.template.map(function(item) {
|
||||
return {
|
||||
|
|
|
@ -9,91 +9,99 @@
|
|||
"term": "Navigation",
|
||||
"description": "Using software tools to browse the web",
|
||||
"tag": "weblit-Navigation",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff4e1f"
|
||||
},
|
||||
{
|
||||
"term": "Web Mechanics",
|
||||
"description": "Understanding the web ecosystem",
|
||||
"tag": "weblit-WebMechanics",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff6969"
|
||||
},
|
||||
{
|
||||
"term": "Search",
|
||||
"description": "Locating information, people and resources via the web",
|
||||
"tag": "weblit-Search",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#fe4040"
|
||||
},
|
||||
{
|
||||
"term": "Credibility",
|
||||
"description": "Critically evaluating information found on the web",
|
||||
"tag": "weblit-Credibility",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff5984"
|
||||
},
|
||||
{
|
||||
"term": "Security",
|
||||
"description": "Keeping systems, identities, and content safe",
|
||||
"tag": "weblit-Security",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#ff004e"
|
||||
},
|
||||
{
|
||||
"term": "Composing for the web",
|
||||
"description": "Creating and curating content for the web",
|
||||
"tag": "weblit-Composing",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#01bc85"
|
||||
},
|
||||
{
|
||||
"term": "Remixing",
|
||||
"description": "Modifying existing web resources to create something new",
|
||||
"tag": "weblit-Remix",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#00ceb8"
|
||||
},
|
||||
{
|
||||
"term": "Design and Accessibility",
|
||||
"description": "Creating universally effective communications through web resources",
|
||||
"tag": "weblit-DesignAccessibility",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#6ecba9"
|
||||
},
|
||||
{
|
||||
"term": "Coding/scripting",
|
||||
"description": "Creating interactive experiences on the web",
|
||||
"tag": "weblit-CodingScripting",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#00967f"
|
||||
},
|
||||
{
|
||||
"term": "Infrastructure",
|
||||
"description": "Understanding the Internet stack",
|
||||
"tag": "weblit-Infrastructure",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#09b773"
|
||||
},
|
||||
{
|
||||
"term": "Sharing and Collaborating",
|
||||
"description": "Jointly creating and providing access to web resources",
|
||||
"tag": "weblit-SharingCollaborating",
|
||||
"deprecates": []
|
||||
},
|
||||
{
|
||||
"term": "Collaborating",
|
||||
"description": "Creating web resources with others",
|
||||
"tag": "weblit-Collaborating",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#739ab1"
|
||||
},
|
||||
{
|
||||
"term": "Community Participation",
|
||||
"description": "Getting involved in web communities and understanding their practices",
|
||||
"tag": "weblit-Community",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#63cfea"
|
||||
},
|
||||
{
|
||||
"term": "Privacy",
|
||||
"description": "Examining the consequences of sharing data online",
|
||||
"tag": "weblit-Privacy",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#00bad6"
|
||||
},
|
||||
{
|
||||
"term": "Open Practices",
|
||||
"description": "Helping to keep the Web democratic and universally accessible",
|
||||
"description": "Helping to keep the web democratic and universally accessible",
|
||||
"tag": "weblit-OpenPractices",
|
||||
"deprecates": []
|
||||
"deprecates": [],
|
||||
"color": "#0097d6"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
test('Main functions exist', function() {
|
||||
test('new WebLiteracyClient() should create an object with .langs and should have .template on its prototype', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
ok(typeof wlc.all === 'function', 'Passed!');
|
||||
ok(typeof wlc.term === 'function', 'Passed!');
|
||||
ok(typeof wlc.description === 'function', 'Passed!');
|
||||
ok(typeof wlc === 'object');
|
||||
ok(typeof WebLiteracyClient.prototype.langs === 'object');
|
||||
ok(WebLiteracyClient.prototype.template.length);
|
||||
});
|
||||
|
||||
test('Langs exist, default en lang exists', function() {
|
||||
test('The default "en" lang should exist', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
ok(typeof wlc.langs === 'object');
|
||||
ok(typeof wlc.langs.en === 'object');
|
||||
});
|
||||
|
||||
test('Template exists', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
ok(typeof wlc.template === 'object');
|
||||
});
|
||||
|
||||
test('Set options works', function() {
|
||||
test('Setting options in the constructor should work', function() {
|
||||
var wlc = new WebLiteracyClient({
|
||||
descriptionSuffix: '-descy'
|
||||
});
|
||||
|
@ -25,7 +19,7 @@ test('Set options works', function() {
|
|||
// TODO: more options
|
||||
});
|
||||
|
||||
test('Set lang works', function() {
|
||||
test('.lang(language) should set the language', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
ok(wlc.strings);
|
||||
wlc.lang('en')
|
||||
|
@ -33,7 +27,7 @@ test('Set lang works', function() {
|
|||
// TODO: test when languages are not supported
|
||||
});
|
||||
|
||||
test('supportedLangs works and contains en', function() {
|
||||
test('.supportedLangs() should return an array containing "en"', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
var langlist = wlc.supportedLangs();
|
||||
|
||||
|
@ -46,7 +40,7 @@ test('supportedLangs works and contains en', function() {
|
|||
|
||||
});
|
||||
|
||||
test('Get term works', function() {
|
||||
test('.term works', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
var tag = wlc.all()[0].tag;
|
||||
var term = wlc.all()[0].term;
|
||||
|
@ -54,7 +48,7 @@ test('Get term works', function() {
|
|||
ok(wlc.term(tag) === term);
|
||||
});
|
||||
|
||||
test('Get description works', function() {
|
||||
test('.description works', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
var desc = wlc.template[0].description;
|
||||
var tag = wlc.template[0].tag;
|
||||
|
@ -62,3 +56,12 @@ test('Get description works', function() {
|
|||
ok(wlc.description(tag) === desc);
|
||||
});
|
||||
|
||||
test('.colo[u]r works', function() {
|
||||
var wlc = new WebLiteracyClient();
|
||||
var color = wlc.template[0].color;
|
||||
var tag = wlc.template[0].tag;
|
||||
|
||||
ok(wlc.color(tag) === color);
|
||||
ok(wlc.colour(tag) === color);
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче