chore: cleanup, node14 and new admin default
This commit is contained in:
parent
c7c18633d7
commit
89bb9a8f25
244 changed files with 3957 additions and 39487 deletions
56
lib/admin/public/bower_components/qr-code/src/polymer/qr-code.html
vendored
Normal file
56
lib/admin/public/bower_components/qr-code/src/polymer/qr-code.html
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<polymer-element name="qr-code"
|
||||
attributes="data format modulesize margin">
|
||||
|
||||
<script>
|
||||
Polymer('qr-code', {
|
||||
|
||||
format: 'png',
|
||||
|
||||
dataChanged: function () {
|
||||
this.generate();
|
||||
},
|
||||
|
||||
generate: function () {
|
||||
var options = {
|
||||
modulesize: this.modulesize,
|
||||
margin: this.margin === 0 ? -1 : this.margin
|
||||
};
|
||||
if (this.format === 'png') {
|
||||
this.generatePNG(options);
|
||||
}
|
||||
else {
|
||||
this.generateHTML(options);
|
||||
}
|
||||
},
|
||||
|
||||
generatePNG: function (options) {
|
||||
var img;
|
||||
try {
|
||||
img = document.createElement('img');
|
||||
img.src = QRCode.generatePNG(this.data, options);
|
||||
this.clear();
|
||||
this.appendChild(img);
|
||||
}
|
||||
catch (e) {
|
||||
console.log('no canvas support');
|
||||
}
|
||||
},
|
||||
|
||||
generateHTML: function (options) {
|
||||
var div = QRCode.generateHTML(this.data, options);
|
||||
this.clear();
|
||||
this.appendChild(div);
|
||||
},
|
||||
|
||||
clear: function () {
|
||||
var i;
|
||||
for (i=0; i<this.children.length; i++) {
|
||||
this.children[i].parentNode.removeChild(this.children[i]);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</polymer-element>
|
||||
Loading…
Add table
Add a link
Reference in a new issue