Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions
@@ -0,0 +1,58 @@
var $ = require('jquery');
var CoreView = require('backbone/core-view');
var iconTemplates = {};
var importAllIconTemplates = function () {
var templates = require.context('./templates', false, /\.tpl$/);
templates.keys().forEach(function (template) {
iconTemplates[template] = templates(template);
});
};
importAllIconTemplates();
module.exports = CoreView.extend({
constructor: function (opts) {
this.placeholder = this._preinitializeWithPlaceholder(opts && opts.placeholder);
CoreView.prototype.constructor.call(this, opts);
},
initialize: function (opts) {
if (!opts || !opts.icon) throw new Error('An icon is required to render IconView');
this.icon = opts.icon;
this.iconTemplate = this._getIconTemplate(this.icon);
if (!this.iconTemplate) {
throw new Error('The selected icon does not have any available template');
}
},
render: function () {
this.$el.html(this.iconTemplate);
if (this.placeholder) {
this.placeholder.replaceWith(this.$el);
}
return this;
},
_getIconTemplate: function (icon) {
var iconTemplate = './' + this.icon + '.tpl';
return iconTemplates[iconTemplate];
},
_preinitializeWithPlaceholder: function (placeholderNode) {
if (!placeholderNode) {
return;
}
var placeholder = $(placeholderNode);
this.tagName = placeholder.prop('tagName');
this.className = placeholder.attr('class');
return placeholder;
}
});
@@ -0,0 +1,7 @@
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Lines" fill="#1785FB">
<path d="M11.6198875,4.92329838 L4.92351677,11.6196692 C4.97280083,11.7390295 5,11.8705079 5,12.0093689 L5,13.9906311 C5,14.5480902 4.55664682,15 3.9906311,15 L2.0093689,15 C1.45190985,15 1,14.5566468 1,13.9906311 L1,12.0093689 C1,11.4519098 1.44335318,11 2.0093689,11 L3.9906311,11 C4.12868508,11 4.26026573,11.0271908 4.38011246,11.0767016 L11.0764832,4.38033084 C11.0271992,4.26097047 11,4.12949214 11,3.9906311 L11,2.0093689 C11,1.45190985 11.4433532,1 12.0093689,1 L13.9906311,1 C14.5480902,1 15,1.44335318 15,2.0093689 L15,3.9906311 C15,4.54809015 14.5566468,5 13.9906311,5 L12.0093689,5 C11.8713149,5 11.7397343,4.97280922 11.6198875,4.92329838 Z M3,3 L3,0 L4,0 L4,3 L7,3 L7,4 L4,4 L4,7 L3,7 L3,4 L0,4 L0,3 L3,3 Z M12,2.0093689 L12,3.9906311 C12,4.00008791 11.9999116,4 12.0093689,4 L13.9906311,4 C14.0000879,4 14,4.00008843 14,3.9906311 L14,2.0093689 C14,1.99991209 14.0000884,2 13.9906311,2 L12.0093689,2 C11.9999121,2 12,1.99991157 12,2.0093689 Z M2,12.0093689 L2,13.9906311 C2,14.0000879 1.99991157,14 2.0093689,14 L3.9906311,14 C4.00008791,14 4,14.0000884 4,13.9906311 L4,12.0093689 C4,11.9999121 4.00008843,12 3.9906311,12 L2.0093689,12 C1.99991209,12 2,11.9999116 2,12.0093689 Z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,7 @@
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Points" fill="#1785FB">
<path d="M3,3 L3,0 L4,0 L4,3 L7,3 L7,4 L4,4 L4,7 L3,7 L3,4 L0,4 L0,3 L3,3 Z M12,2.0093689 L12,3.9906311 C12,4.00008791 11.9999116,4 12.0093689,4 L13.9906311,4 C14.0000879,4 14,4.00008843 14,3.9906311 L14,2.0093689 C14,1.99991209 14.0000884,2 13.9906311,2 L12.0093689,2 C11.9999121,2 12,1.99991157 12,2.0093689 Z M11,2.0093689 C11,1.45190985 11.4433532,1 12.0093689,1 L13.9906311,1 C14.5480902,1 15,1.44335318 15,2.0093689 L15,3.9906311 C15,4.54809015 14.5566468,5 13.9906311,5 L12.0093689,5 C11.4519098,5 11,4.55664682 11,3.9906311 L11,2.0093689 Z M12,12.0093689 L12,13.9906311 C12,14.0000879 11.9999116,14 12.0093689,14 L13.9906311,14 C14.0000879,14 14,14.0000884 14,13.9906311 L14,12.0093689 C14,11.9999121 14.0000884,12 13.9906311,12 L12.0093689,12 C11.9999121,12 12,11.9999116 12,12.0093689 Z M11,12.0093689 C11,11.4519098 11.4433532,11 12.0093689,11 L13.9906311,11 C14.5480902,11 15,11.4433532 15,12.0093689 L15,13.9906311 C15,14.5480902 14.5566468,15 13.9906311,15 L12.0093689,15 C11.4519098,15 11,14.5566468 11,13.9906311 L11,12.0093689 Z M2,12.0093689 L2,13.9906311 C2,14.0000879 1.99991157,14 2.0093689,14 L3.9906311,14 C4.00008791,14 4,14.0000884 4,13.9906311 L4,12.0093689 C4,11.9999121 4.00008843,12 3.9906311,12 L2.0093689,12 C1.99991209,12 2,11.9999116 2,12.0093689 Z M1,12.0093689 C1,11.4519098 1.44335318,11 2.0093689,11 L3.9906311,11 C4.54809015,11 5,11.4433532 5,12.0093689 L5,13.9906311 C5,14.5480902 4.55664682,15 3.9906311,15 L2.0093689,15 C1.45190985,15 1,14.5566468 1,13.9906311 L1,12.0093689 Z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,7 @@
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Polygons" fill="#1785FB">
<path d="M13.9906311,5 L14,5 L14,11 L13.9906311,11 C14.5480902,11 15,11.4433532 15,12.0093689 L15,13.9906311 C15,14.5480902 14.5566468,15 13.9906311,15 L12.0093689,15 C11.4519098,15 11,14.5566468 11,13.9906311 L11,14 L5,14 L5,13.9906311 C5,14.5480902 4.55664682,15 3.9906311,15 L2.0093689,15 C1.45190985,15 1,14.5566468 1,13.9906311 L1,12.0093689 C1,11.4519098 1.44335318,11 2.0093689,11 L3.9906311,11 C4.12868508,11 4.26026573,11.0271908 4.38011246,11.0767016 L11.0764832,4.38033084 C11.0271992,4.26097047 11,4.12949214 11,3.9906311 L11,2.0093689 C11,1.45190985 11.4433532,1 12.0093689,1 L13.9906311,1 C14.5480902,1 15,1.44335318 15,2.0093689 L15,3.9906311 C15,4.54809015 14.5566468,5 13.9906311,5 Z M13,5 L12.0093689,5 C11.8713149,5 11.7397343,4.97280922 11.6198875,4.92329838 L4.92351677,11.6196692 C4.97280083,11.7390295 5,11.8705079 5,12.0093689 L5,13 L11,13 L11,12.0093689 C11,11.4519098 11.4433532,11 12.0093689,11 L13,11 L13,5 Z M3,3 L3,0 L4,0 L4,3 L7,3 L7,4 L4,4 L4,7 L3,7 L3,4 L0,4 L0,3 L3,3 Z M12,2.0093689 L12,3.9906311 C12,4.00008791 11.9999116,4 12.0093689,4 L13.9906311,4 C14.0000879,4 14,4.00008843 14,3.9906311 L14,2.0093689 C14,1.99991209 14.0000884,2 13.9906311,2 L12.0093689,2 C11.9999121,2 12,1.99991157 12,2.0093689 Z M2,12.0093689 L2,13.9906311 C2,14.0000879 1.99991157,14 2.0093689,14 L3.9906311,14 C4.00008791,14 4,14.0000884 4,13.9906311 L4,12.0093689 C4,11.9999121 4.00008843,12 3.9906311,12 L2.0093689,12 C1.99991209,12 2,11.9999116 2,12.0093689 Z M12,12.0093689 L12,13.9906311 C12,14.0000879 11.9999116,14 12.0093689,14 L13.9906311,14 C14.0000879,14 14,14.0000884 14,13.9906311 L14,12.0093689 C14,11.9999121 14.0000884,12 13.9906311,12 L12.0093689,12 C11.9999121,12 12,11.9999116 12,12.0093689 Z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -0,0 +1,3 @@
<svg width="12px" height="12px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path fill="#1785FB" d="M8,8 L8,1 L9,1 L9,8 L16,8 L16,9 L9,9 L9,16 L8,16 L8,9 L1,9 L1,8 L8,8 Z" />
</svg>

After

Width:  |  Height:  |  Size: 196 B

@@ -0,0 +1,11 @@
<svg width="100%" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon-font_114_Warning</title>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Artboard-1" transform="translate(-9001.000000, -11000.000000)" fill-rule="nonzero" fill="#FEB100">
<g id="icon-font_114_Warning" transform="translate(9001.000000, 11000.000000)">
<path d="M47.3618699,443.171714 C40.4022689,456.721101 41.0006423,457.65748 56.75075,457.65748 L441.243856,457.65748 C456.985511,457.65748 457.59007,456.716689 450.632737,443.171714 L248.997303,50.6152213 L47.3618699,443.171714 Z M210.115762,31.2931921 C231.589444,-10.5131174 266.489496,-10.3489299 287.878844,31.2931921 L489.747111,424.302981 C511.220794,466.109288 489.302388,500 441.243856,500 L56.75075,500 C8.48945932,500 -13.1418536,465.945101 8.24749422,424.302981 L210.115762,31.2931921 Z M222.781864,372.97244 L222.781864,415.31496 L266.474263,415.31496 L266.474263,372.97244 L222.781864,372.97244 Z M222.781864,203.602361 L222.781864,330.62992 L266.474263,330.62992 L266.474263,203.602361 L222.781864,203.602361 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB