Skip to content

Instantly share code, notes, and snippets.

View StErMi's full-sized avatar
🔥
let's go!

StErMi StErMi

🔥
let's go!
View GitHub Profile
@StErMi
StErMi / bower.json
Created May 15, 2017 10:21
openui5-qrcode bower.json
{
"name": "openui5-qrcode",
"description": "An openui5 custom control to render a QR Code",
"main": "index.js",
"authors": [
"Emanuele Ricci <stermi@gmail.com>"
],
"license": "Apache-2.0",
"keywords": [
@StErMi
StErMi / Gruntfile.js
Created May 15, 2017 10:30
openui5-qrcode Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
dir: {
src: 'src',
src_qrcode: 'node_modules/qrcodejs',
dest: 'dist',
demo: 'demo',
bower_components: 'bower_components'
@StErMi
StErMi / manifest.json
Created May 15, 2017 13:14
openui5-qrcode manifest.json
"sap.ui5": {
...
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
...
"it.designfuture.qrcode": {}
}
},
"resourceRoots": {
@StErMi
StErMi / View.xml
Created May 15, 2017 13:16
openui5-qrcode View.xml
<lab:QRCode
id="customQRCode"
text="UI5 Rocks!"
width="256"
height="256"
colorDark="#000"
colorLight="#FFF"
correctLevel="2"
/>
@StErMi
StErMi / Parameters.md
Created May 15, 2017 13:17
openui5-qrcode Parameters.md
Name Type Default Description
text string "" Text embedded in the QRCode
width int 256 QRCode's width
height int 256 QRCode's height
colorDark string "#000000" HTML color (black/#ffffff) of the dark part of the QRCode
colorLight string "#ffffff" HTML color (white/#ffffff) of the dark part of the QRCode
correctLevel int 2 Text embedded in the QRCode
@StErMi
StErMi / Methods.md
Last active May 15, 2017 14:01
openui5-qrcode Methods.md
Name Description
reDraw Draw the QRCode. If the QR Code does not exist it creates a new one, if it already exist it just refresh it
clear Clear the QR Code
getText Return the text of the QR Code
setText Set a new text of the QR Code
getWidth Return the width of the QR Code
setWidth Set the width of the QR Code
getHeight Return the height of the QR Code
setHeight Set the height of the QR Code
@StErMi
StErMi / QRCode.js
Last active May 22, 2017 13:35
it.designfuture.qrcode.QRCode example
sap.ui.define([
"sap/ui/core/Control"
], function (Control) {
"use strict";
return Control.extend("it.designfuture.qrcode.QRCode", {
metadata : {
properties : {},
aggregations : {},
events : {}
},
@StErMi
StErMi / .library
Created May 23, 2017 09:56
QRCode .library
<?xml version="1.0" encoding="UTF-8" ?>
<library xmlns="http://www.sap.com/sap.ui.library.xsd" >
<name>it.designfuture.qrcode</name>
<vendor>OpenUI5 QRCode</vendor>
<documentation>Custom Control to render a QRCode</documentation>
<dependencies>
<dependency>
@StErMi
StErMi / library.js
Last active June 22, 2017 11:17
QRCode Custom Control library.js
/**
* Initialization Code and shared classes of library it.designfuture.qrcode.
*/
sap.ui.define([
'jquery.sap.global',
'sap/ui/core/library' // library dependency
], function(jQuery, library) {
"use strict";
@StErMi
StErMi / QRCodeRenderer.js
Last active June 22, 2017 11:18
QRCode QRCodeRenderer.js
sap.ui.define(['jquery.sap.global'],
function(jQuery) {
"use strict";
/**
* QRCode renderer.
* @static
* @namespace
*/