-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* general code cleanup, * moved unused and/or old started modules to …
…deprecated folder, * name updated, * keywords updated, * loading messages generator ready to use
- Loading branch information
Matheus Cesar C. - Matsukii
committed
Oct 4, 2019
1 parent
ea85240
commit f3a96dc
Showing
14 changed files
with
142 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
node_modules | ||
desktop.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,10 @@ | |
* @description blacklisted og get urls | ||
*/ | ||
module.exports = { | ||
items = [ | ||
urls = [ | ||
|
||
], | ||
words = [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,36 @@ | ||
module.exports = (params, saveFile = false) => { | ||
qrcode = require('qrcode-svg'); | ||
|
||
// url ? dat = dat.split('*').join('/') : null | ||
// url ? console.log(dat) : null | ||
|
||
|
||
let colod = '#646464'; | ||
|
||
if(params.dark){ | ||
colod = '#CCCCCC' | ||
} | ||
else{ | ||
if(params.color != undefined){ | ||
colod = `#${params.color}`; | ||
} | ||
else{ | ||
colod = '#222222'; | ||
} | ||
params.color != undefined ? colod = `#${params.color}` : colod = '#222222'; | ||
} | ||
|
||
let bcg = 'transparent'; | ||
if(params.bg != undefined){ | ||
bcg = `#${params.bg}`; | ||
} | ||
else{ | ||
bcg = 'transparent' | ||
} | ||
|
||
params.bg != undefined ? bcg = `#${params.bg}` : bcg = 'transparent'; | ||
|
||
let config = { | ||
content: params.url, | ||
padding: 1, | ||
width: params.width || 100, | ||
height: params.width || 100, | ||
color: colod, | ||
background: bcg, | ||
content: params.url, | ||
width: params.width || 100, | ||
height: params.width || 100, | ||
} | ||
|
||
var qr = new qrcode(config); | ||
|
||
// if(saveFile){ | ||
// qr.save("sample.svg", function(error) { | ||
// if (error) throw error; | ||
// console.log("Done!"); | ||
// }); | ||
// } | ||
// only for test | ||
if(saveFile){ | ||
qr.save("sample.svg", function(error) { | ||
if (error) throw error; | ||
console.log("Done!"); | ||
}); | ||
} | ||
|
||
return qr.svg() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @description returned messages if any parameter is sended, | ||
* later should be converted to html and send file instead | ||
*/ | ||
module.exports = { | ||
qrNoParams: `<title>qr gen API - Please send the params!</title> Please send params:<br> (need url/data at least)<br> corection level = M, padding = 1 (unavaliable to set)<br> u: url<br> d: dark (color = #cccccc, overrides color and bg param)<br> w: width and height<br> c: color (HEX, without the '#'), the default is #222222 and #CCCCCC<br> bg: background color (HEX, without the '#'), the default is transparent`, | ||
filterNoMessage: 'No message given <br>use ?msg=(your_message_here)', | ||
|
||
}; |
Oops, something went wrong.