Skip to content
GitLab
Menu
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
a931bc49
Commit
a931bc49
authored
Sep 19, 2017
by
bbaer
Browse files
toggle elements get generated now
parent
937d9b25
Changes
2
Hide whitespace changes
Inline
Side-by-side
javascript/src/Plugins/qfq.fabric.js
View file @
a931bc49
...
...
@@ -20,6 +20,7 @@ $(function (n) {
this
.
controlElement
=
{};
this
.
emojiContainer
=
{};
this
.
textContainer
=
{};
this
.
userTextInput
=
{};
this
.
canvas
=
{};
this
.
activeColor
=
{
red
:
0
,
green
:
68
,
blue
:
255
,
opacity
:
1
};
this
.
brushSize
=
2
;
...
...
@@ -30,6 +31,7 @@ $(function (n) {
this
.
userText
=
""
;
this
.
drawRectangleMode
=
false
;
this
.
drawTextBoxMode
=
false
;
this
.
emojiMode
=
false
;
this
.
isHighlightMode
=
false
;
this
.
isDrawingMode
=
true
;
this
.
isDown
=
false
;
...
...
@@ -133,7 +135,7 @@ $(function (n) {
}
if
(
o
.
hasToggleElement
)
{
console
.
log
(
o
.
toggleElement
);
$
(
"
#
"
+
o
.
toggleElement
)
.
slideToggle
();
that
.
qFabric
[
o
.
toggleElement
]
.
slideToggle
();
}
}
else
{
that
.
deactivateMode
(
o
);
...
...
@@ -149,7 +151,9 @@ $(function (n) {
$button
.
addClass
(
"
btn-default
"
);
this
.
qFabric
[
o
.
toggle
]
=
false
;
}
if
(
o
.
hasToggleElement
)
{
this
.
qFabric
[
o
.
toggleElement
].
slideUp
();
}
};
ModeSettings
.
prototype
.
getButtonById
=
function
(
needle
)
{
...
...
@@ -239,16 +243,27 @@ $(function (n) {
id
:
'
qfq-fabric-control
'
});
var
emojiContainer
=
$
(
'
<div>
'
,
{
style
:
'
display: block;
'
style
:
'
display: none;
'
});
var
textContainer
=
$
(
'
<div>
'
,
{
style
:
'
display: none;
'
});
var
textArea
=
$
(
'
<textarea>
'
,
{
class
:
'
fabric-text
'
,
placeholder
:
'
Write a text and then draw a textbox over the image
'
});
var
that
=
this
;
canvas
.
id
=
"
c1
"
;
canvas
.
width
=
$
(
'
#fabric
'
).
innerWidth
();
canvas
.
height
=
canvas
.
width
/
3
*
4
;
textContainer
.
append
(
textArea
);
$
(
'
#fabric
'
).
append
(
controlElement
);
$
(
'
#fabric
'
).
append
(
emojiContainer
);
$
(
'
#fabric
'
).
append
(
textContainer
);
this
.
controlElement
=
controlElement
;
this
.
emojiContainer
=
emojiContainer
;
this
.
textContainer
=
textContainer
;
this
.
userTextInput
=
textArea
;
$
(
'
#fabric
'
).
append
(
canvas
);
this
.
canvas
=
this
.
__canvas
=
new
fabric
.
Canvas
(
canvas
,
{
isDrawingMode
:
true
,
...
...
mockup/mockData/fabric.modes.json
View file @
a931bc49
...
...
@@ -30,9 +30,20 @@
"isToggle"
:
true
,
"toggle"
:
"drawTextBoxMode"
,
"hasToggleElement"
:
true
,
"toggleElement"
:
"
user-
text
-c
ont
rol
"
,
"toggleElement"
:
"text
C
ont
ainer
"
,
"icon"
:
"glyphicon-text-height"
},
{
"name"
:
"emoji"
,
"selector"
:
"add-emoji"
,
"requiresDrawing"
:
false
,
"requiresSelection"
:
true
,
"isToggle"
:
true
,
"toggle"
:
"emojiMode"
,
"hasToggleElement"
:
true
,
"toggleElement"
:
"emojiContainer"
,
"icon"
:
"glyphicon-ice-lolly-tasted"
},
{
"name"
:
"rectangle"
,
"selector"
:
"add-rect"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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