Skip to content

Commit

Permalink
add GraniteQRCodeGenerator and all needed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
otto-ringhofer committed Jul 27, 2018
1 parent c705ea0 commit ac8e05f
Show file tree
Hide file tree
Showing 8 changed files with 819 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ libraryDependencies ++= Seq(
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided",
"com.vaadin" % "vaadin-core" % vaadinVersion,
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
GraniteQRCodeGenerator.qrcode,
"org.slf4j" % "slf4j-simple" % "1.7.25"
)

Expand Down
1 change: 1 addition & 0 deletions project/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/project/
/target/
21 changes: 21 additions & 0 deletions project/GraniteQRCodeGenerator.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sbt._

object GraniteQRCodeGenerator {

val qrcodeVersion = "1.1.4"

/** Granite QRCode Generator
* https://www.webcomponents.org/element/LostInBrittany/granite-qrcode-generator
*
* https://mvnrepository.com/artifact/org.webjars.bowergithub.lostinbrittany/granite-qrcode-generator/1.1.4
*
* intransitive, because of the reference to org.webjars.bowergithub.lifthrasiir » qr.js [0.0.20110119...
* is not available in repositories
*
* Content manually copied to frontend/bower_components/qrjs
*
*/

val qrcode = "org.webjars.bowergithub.lostinbrittany" % "granite-qrcode-generator" % qrcodeVersion intransitive()

}
5 changes: 4 additions & 1 deletion src/main/scala/org/scala_vienna/raffle/CreatorView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ import org.vaadin.addons.vaactor.Vaactor
)
class CreatorView extends VerticalLayout with Vaactor.HasActor {

val qrCode = new GraniteQRCodeGenerator()

add(
new H1("Vaactor Raffle"),
new Button("Create raffle", { _ => Manager ! Manager.Create })
new Button("Create raffle", { _ => Manager ! Manager.Create }),
new Button("QR-Code", _ => add(qrCode))
)

override def receive: Receive = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.scala_vienna.raffle

import com.vaadin.flow.component.dependency.HtmlImport
import com.vaadin.flow.component.{Component, Tag}

@Tag("granite-qrcode-generator")
@HtmlImport("bower_components/granite-qrcode-generator/granite-qrcode-generator.html")
class GraniteQRCodeGenerator extends Component {

}
14 changes: 14 additions & 0 deletions src/main/webapp/frontend/bower_components/qrjs/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "qrjs",
"homepage": "https://github.com/lifthrasiir/qr.js",
"version": "0.0.20110119",
"_release": "0.0.20110119",
"_resolution": {
"type": "version",
"tag": "v0.0.20110119",
"commit": "b3d7fdedeb909f9b12b8435697d75175d961cbc6"
},
"_source": "git://github.com/lifthrasiir/qr.js.git",
"_target": "*",
"_originalSource": "lifthrasiir/qr.js"
}
8 changes: 8 additions & 0 deletions src/main/webapp/frontend/bower_components/qrjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# qr.js: QR code generator in pure Javascript (2011)

This is a fairly standalone script for producing QR code on the fly.
Originally developed for my own interest, the code is fully commented and well-structured.
The code is in the public domain (or to be exact, [Creative Commons Zero](https://creativecommons.org/publicdomain/zero/1.0/)),
and you can use it for absolutely any purpose.

See also a [node.js module based on qr.js](https://github.com/shesek/qruri), packaged by Nadav Ivgi.
Loading

0 comments on commit ac8e05f

Please sign in to comment.