Further cleanup and removal of unnecessary functions. Pull some strings out for i18n.

This commit is contained in:
Sean Lip
2017-01-18 17:45:15 -08:00
parent d2bfd134b6
commit 59b074d19f
7 changed files with 27 additions and 64 deletions

View File

@@ -18,9 +18,9 @@
*/
/**
* @fileoverview Angular2 utility service for multiple components. All
* functions in this service should be stateless, since this is a singleton
* service that is used for the entire application.
* @fileoverview Angular2 utility service for multiple components. This is a
* singleton service that is used for the entire application. In general, it
* should only be used as a stateless adapter for native Blockly functions.
*
* @author madeeha@google.com (Madeeha Ghori)
*/
@@ -30,19 +30,6 @@ blocklyApp.ID_FOR_EMPTY_WORKSPACE_BTN = 'blocklyEmptyWorkspaceBtn';
blocklyApp.UtilsService = ng.core.Class({
constructor: [function() {}],
generateUniqueId: function() {
return 'blockly-' + Blockly.utils.genUid();
},
generateIds: function(elementsList) {
var idMap = {};
for (var i = 0; i < elementsList.length; i++){
idMap[elementsList[i]] = this.generateUniqueId();
}
return idMap;
},
generateAriaLabelledByAttr: function(mainLabel, secondLabel) {
return mainLabel + (secondLabel ? ' ' + secondLabel : '');
},
getBlockDescription: function(block) {
// We use 'BLANK' instead of the default '?' so that the string is read
// out. (By default, screen readers tend to ignore punctuation.)