Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
7f1e4e84
Commit
7f1e4e84
authored
Jan 30, 2018
by
Carsten Rose
Browse files
Merge branch 'punktetool' of git.math.uzh.ch:typo3/qfq into punktetool
parents
a2987433
bd97417a
Changes
4
Hide whitespace changes
Inline
Side-by-side
javascript/src/Plugins/qfq.fabric.js
View file @
7f1e4e84
...
...
@@ -24,7 +24,7 @@ $(function (n) {
});
this
.
emojiContainer
=
{};
this
.
eventEmitter
=
new
EventEmitter
();
this
.
Q
fq
Form
=
n
.
QfqForm
;
this
.
q
fq
Page
=
{}
;
this
.
textContainer
=
{};
this
.
userTextInput
=
{};
this
.
outputField
=
{};
...
...
@@ -244,12 +244,13 @@ $(function (n) {
fabric
.
Object
.
prototype
.
transparentCorners
=
false
;
};
n
.
Fabric
.
prototype
.
initialize
=
function
(
$fabricElement
)
{
n
.
Fabric
.
prototype
.
initialize
=
function
(
$fabricElement
,
qfqPage
)
{
var
inputField
=
$fabricElement
.
data
(
'
control-name
'
);
var
imageOutput
=
$fabricElement
.
data
(
'
image-output
'
);
var
viewOnly
=
$fabricElement
.
data
(
'
view-only
'
)
||
false
;
var
editImage
=
$fabricElement
.
data
(
'
edit-image
'
)
||
false
;
var
resizeWidth
=
$fabricElement
.
data
(
'
image-resize-width
'
)
||
0
;
this
.
qfqPage
=
qfqPage
;
this
.
parentElement
=
$fabricElement
;
this
.
backgroundImage
=
$fabricElement
.
data
(
'
background-image
'
)
||
false
;
this
.
fabricJSON
=
$fabricElement
.
data
(
'
fabric-json
'
)
||
false
;
...
...
@@ -940,11 +941,13 @@ $(function (n) {
/* Important! Changes only possible after initialisation */
if
(
this
.
userChangePossible
)
{
var
that
=
this
;
console
.
log
(
'
test
'
);
this
.
outputField
.
val
(
JSON
.
stringify
(
that
.
canvas
.
toJSON
()));
var
$saveButton
=
$
(
"
#save-button
"
);
$saveButton
.
removeClass
(
"
disabled
"
);
$saveButton
.
addClass
(
$saveButton
.
data
(
'
class-on-change
'
)
||
'
alert-warning
'
);
$saveButton
.
removeAttr
(
"
disabled
"
);
if
(
this
.
qfqPage
.
qfqForm
)
{
this
.
qfqPage
.
qfqForm
.
eventEmitter
.
emitEvent
(
'
form.changed
'
,
n
.
EventEmitter
.
makePayload
(
that
,
null
));
}
else
{
throw
(
"
Error: Couldn't initialize qfqForm - not possible to send form.changed event
"
);
}
}
};
...
...
javascript/src/QfqForm.js
View file @
7f1e4e84
...
...
@@ -744,6 +744,7 @@ var QfqNS = QfqNS || {};
if
(
this
.
formImmutableDueToConcurrentAccess
)
{
return
;
}
console
.
log
(
"
QFQForm Changehandler
"
);
this
.
getSaveButton
().
removeClass
(
"
disabled
"
);
this
.
getSaveButton
().
addClass
(
this
.
getSaveButtonAttentionClass
());
this
.
getSaveButton
().
removeAttr
(
"
disabled
"
);
...
...
@@ -940,8 +941,7 @@ var QfqNS = QfqNS || {};
this
.
applyFormConfiguration
(
data
[
'
form-update
'
]);
}
if
(
data
[
'
element-update
'
])
{
this
.
applyElementConfiguration
(
data
[
'
element-update
'
]);
if
(
data
[
'
element-update
'
])
{
this
.
applyElementConfiguration
(
data
[
'
element-update
'
]);
}
if
(
data
.
redirect
===
"
url
"
&&
data
[
'
redirect-url
'
])
{
...
...
@@ -1132,6 +1132,7 @@ var QfqNS = QfqNS || {};
n
.
QfqForm
.
prototype
.
applyElementConfiguration
=
function
(
configuration
)
{
if
(
!
configuration
)
{
console
.
error
(
"
No configuration for Element Update found
"
);
return
;
}
...
...
javascript/src/QfqPage.js
View file @
7f1e4e84
...
...
@@ -24,6 +24,7 @@ var QfqNS = QfqNS || {};
* @name QfqNS.QfqPage
*/
n
.
QfqPage
=
function
(
settings
)
{
this
.
qfqForm
=
{};
this
.
settings
=
$
.
extend
(
{
tabsId
:
"
qfqTabs
"
,
...
...
@@ -88,6 +89,17 @@ var QfqNS = QfqNS || {};
this
.
qfqForm
=
null
;
}
// Initialize Fabric to access form events
try
{
var
page
=
this
;
$
(
"
.fabric
"
).
each
(
function
()
{
var
qfqFabric
=
new
QfqNS
.
Fabric
();
qfqFabric
.
initialize
(
$
(
this
),
page
);
});
}
catch
(
e
)
{
n
.
Log
.
error
(
e
.
message
);
}
QfqNS
.
TypeAhead
.
install
(
this
.
settings
.
typeAheadUrl
);
QfqNS
.
CharacterCount
.
initialize
();
};
...
...
mockup/fabric.html
View file @
7f1e4e84
...
...
@@ -77,8 +77,7 @@
QfqNS
.
Log
.
level
=
0
;
// Just for mockup, init() function called from new QfqNS.Plugin class maybe.
var
qfqFabric
=
new
QfqNS
.
Fabric
();
qfqFabric
.
initialize
(
$
(
"
.fabric
"
));
});
</script>
</body>
...
...
Write
Preview
Markdown
is supported
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