Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
40 lines
959 B
JavaScript
Executable file
40 lines
959 B
JavaScript
Executable file
'use strict';
|
|
|
|
(function(exports) {
|
|
var MockBaseIcon = function(name) {
|
|
if (name) {
|
|
this.name = name;
|
|
}
|
|
this.element = document.createElement('div');
|
|
var pureName = this.name.replace(/Icon$/, '');
|
|
this.dashPureName = this.camelToDash(pureName);
|
|
};
|
|
MockBaseIcon.prototype = {
|
|
element: null,
|
|
name: 'MockBaseIcon',
|
|
show: function() {},
|
|
hide: function() {},
|
|
isVisible: function() {},
|
|
setOrder: function() {}
|
|
};
|
|
|
|
MockBaseIcon.prototype.camelToDash = function(strings) {
|
|
var i = 0;
|
|
var ch = '';
|
|
while (i <= strings.length) {
|
|
var character = strings.charAt(i);
|
|
if (character !== character.toLowerCase()) {
|
|
if (ch === '') {
|
|
ch += character.toLowerCase();
|
|
} else {
|
|
ch += '-' + character.toLowerCase();
|
|
}
|
|
} else {
|
|
ch += character;
|
|
}
|
|
i++;
|
|
}
|
|
return ch;
|
|
};
|
|
exports.MockBaseIcon = MockBaseIcon;
|
|
}(window));
|