Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
b001de5f
Commit
b001de5f
authored
Sep 15, 2017
by
bbaer
Browse files
just some comments
parent
41d40f62
Changes
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/Plugins/qfq.fabric.js
View file @
b001de5f
/**
* Created by bbaer on 5/5/17.
* @author Benjamin Baer <benjamin.baer@math.uzh.ch>
*
* qfq.fabric.js: Integrates a callable fabric.js html5 canvas.
* Currently in development for a special case, may be expanded
* and integrated into qfq.
*
* Buttons and color switches are generated on basis of a json.
* May be expanded to make it easy to create new brushes and stuff.
*
* Probably will soon open up "easy" ways for you to create plugins
* that integrate into the qfq js client.
*
*/
var
QfqNS
=
QfqNS
||
{};
...
...
@@ -32,11 +43,12 @@ $(function (n) {
this
.
origX
=
0
;
this
.
origY
=
0
;
// Handles button states and generation of said buttons. Should be renamed.
function
ModeSettings
()
{
this
.
qFabric
;
this
.
qFabric
=
{}
;
this
.
myButtons
=
[];
this
.
myColors
=
[];
this
.
myModes
=
{
modes
:
[],
currentMode
:
""
};
this
.
myModes
=
{
modes
:
[],
currentMode
:
""
,
colors
:
[]
};
}
ModeSettings
.
prototype
.
initialize
=
function
(
qfqFabric
,
uri
)
{
...
...
@@ -367,7 +379,7 @@ $(function (n) {
};
// Calls additional functions on button press, could eventually be integrated to
// the button json
// the button
/mode
json
n
.
Fabric
.
prototype
.
buttonPress
=
function
(
string
,
$button
)
{
this
.
modeSettings
.
activateMode
(
string
,
$button
);
switch
(
string
)
{
...
...
@@ -420,8 +432,7 @@ $(function (n) {
n
.
fabric
=
new
n
.
Fabric
();
n
.
fabric
.
setBackground
(
"
../mockup/mockData/Scan2a.jpeg
"
);
// Will be integrated shortly
// Will be integrated shortly or scrapped entirely.
$
(
"
#text-bg-submit
"
).
on
(
"
click
"
,
function
()
{
n
.
fabric
.
userText
=
$
(
"
#text-user-value
"
).
val
();
n
.
fabric
.
drawTextBoxMode
=
true
;
...
...
@@ -430,7 +441,7 @@ $(function (n) {
/*
To be integrated, save to localstorage & at the and as ajax to server.
Export to image is a maybe.
Export to image is a maybe.
Mainly here for future reference.
$("#save1").on("click", function() {
if (!n.fabric.saveOne) {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment