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
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) {
...
@@ -24,7 +24,7 @@ $(function (n) {
});
});
this
.
emojiContainer
=
{};
this
.
emojiContainer
=
{};
this
.
eventEmitter
=
new
EventEmitter
();
this
.
eventEmitter
=
new
EventEmitter
();
this
.
Q
fq
Form
=
n
.
QfqForm
;
this
.
q
fq
Page
=
{}
;
this
.
textContainer
=
{};
this
.
textContainer
=
{};
this
.
userTextInput
=
{};
this
.
userTextInput
=
{};
this
.
outputField
=
{};
this
.
outputField
=
{};
...
@@ -244,12 +244,13 @@ $(function (n) {
...
@@ -244,12 +244,13 @@ $(function (n) {
fabric
.
Object
.
prototype
.
transparentCorners
=
false
;
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
inputField
=
$fabricElement
.
data
(
'
control-name
'
);
var
imageOutput
=
$fabricElement
.
data
(
'
image-output
'
);
var
imageOutput
=
$fabricElement
.
data
(
'
image-output
'
);
var
viewOnly
=
$fabricElement
.
data
(
'
view-only
'
)
||
false
;
var
viewOnly
=
$fabricElement
.
data
(
'
view-only
'
)
||
false
;
var
editImage
=
$fabricElement
.
data
(
'
edit-image
'
)
||
false
;
var
editImage
=
$fabricElement
.
data
(
'
edit-image
'
)
||
false
;
var
resizeWidth
=
$fabricElement
.
data
(
'
image-resize-width
'
)
||
0
;
var
resizeWidth
=
$fabricElement
.
data
(
'
image-resize-width
'
)
||
0
;
this
.
qfqPage
=
qfqPage
;
this
.
parentElement
=
$fabricElement
;
this
.
parentElement
=
$fabricElement
;
this
.
backgroundImage
=
$fabricElement
.
data
(
'
background-image
'
)
||
false
;
this
.
backgroundImage
=
$fabricElement
.
data
(
'
background-image
'
)
||
false
;
this
.
fabricJSON
=
$fabricElement
.
data
(
'
fabric-json
'
)
||
false
;
this
.
fabricJSON
=
$fabricElement
.
data
(
'
fabric-json
'
)
||
false
;
...
@@ -940,11 +941,13 @@ $(function (n) {
...
@@ -940,11 +941,13 @@ $(function (n) {
/* Important! Changes only possible after initialisation */
/* Important! Changes only possible after initialisation */
if
(
this
.
userChangePossible
)
{
if
(
this
.
userChangePossible
)
{
var
that
=
this
;
var
that
=
this
;
console
.
log
(
'
test
'
);
this
.
outputField
.
val
(
JSON
.
stringify
(
that
.
canvas
.
toJSON
()));
this
.
outputField
.
val
(
JSON
.
stringify
(
that
.
canvas
.
toJSON
()));
var
$saveButton
=
$
(
"
#save-button
"
);
if
(
this
.
qfqPage
.
qfqForm
)
{
$saveButton
.
removeClass
(
"
disabled
"
);
this
.
qfqPage
.
qfqForm
.
eventEmitter
.
emitEvent
(
'
form.changed
'
,
n
.
EventEmitter
.
makePayload
(
that
,
null
));
$saveButton
.
addClass
(
$saveButton
.
data
(
'
class-on-change
'
)
||
'
alert-warning
'
);
}
else
{
$saveButton
.
removeAttr
(
"
disabled
"
);
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 || {};
...
@@ -744,6 +744,7 @@ var QfqNS = QfqNS || {};
if
(
this
.
formImmutableDueToConcurrentAccess
)
{
if
(
this
.
formImmutableDueToConcurrentAccess
)
{
return
;
return
;
}
}
console
.
log
(
"
QFQForm Changehandler
"
);
this
.
getSaveButton
().
removeClass
(
"
disabled
"
);
this
.
getSaveButton
().
removeClass
(
"
disabled
"
);
this
.
getSaveButton
().
addClass
(
this
.
getSaveButtonAttentionClass
());
this
.
getSaveButton
().
addClass
(
this
.
getSaveButtonAttentionClass
());
this
.
getSaveButton
().
removeAttr
(
"
disabled
"
);
this
.
getSaveButton
().
removeAttr
(
"
disabled
"
);
...
@@ -940,8 +941,7 @@ var QfqNS = QfqNS || {};
...
@@ -940,8 +941,7 @@ var QfqNS = QfqNS || {};
this
.
applyFormConfiguration
(
data
[
'
form-update
'
]);
this
.
applyFormConfiguration
(
data
[
'
form-update
'
]);
}
}
if
(
data
[
'
element-update
'
])
{
if
(
data
[
'
element-update
'
])
{
this
.
applyElementConfiguration
(
data
[
'
element-update
'
]);
this
.
applyElementConfiguration
(
data
[
'
element-update
'
]);
}
}
if
(
data
.
redirect
===
"
url
"
&&
data
[
'
redirect-url
'
])
{
if
(
data
.
redirect
===
"
url
"
&&
data
[
'
redirect-url
'
])
{
...
@@ -1132,6 +1132,7 @@ var QfqNS = QfqNS || {};
...
@@ -1132,6 +1132,7 @@ var QfqNS = QfqNS || {};
n
.
QfqForm
.
prototype
.
applyElementConfiguration
=
function
(
configuration
)
{
n
.
QfqForm
.
prototype
.
applyElementConfiguration
=
function
(
configuration
)
{
if
(
!
configuration
)
{
if
(
!
configuration
)
{
console
.
error
(
"
No configuration for Element Update found
"
);
return
;
return
;
}
}
...
...
javascript/src/QfqPage.js
View file @
7f1e4e84
...
@@ -24,6 +24,7 @@ var QfqNS = QfqNS || {};
...
@@ -24,6 +24,7 @@ var QfqNS = QfqNS || {};
* @name QfqNS.QfqPage
* @name QfqNS.QfqPage
*/
*/
n
.
QfqPage
=
function
(
settings
)
{
n
.
QfqPage
=
function
(
settings
)
{
this
.
qfqForm
=
{};
this
.
settings
=
$
.
extend
(
this
.
settings
=
$
.
extend
(
{
{
tabsId
:
"
qfqTabs
"
,
tabsId
:
"
qfqTabs
"
,
...
@@ -88,6 +89,17 @@ var QfqNS = QfqNS || {};
...
@@ -88,6 +89,17 @@ var QfqNS = QfqNS || {};
this
.
qfqForm
=
null
;
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
.
TypeAhead
.
install
(
this
.
settings
.
typeAheadUrl
);
QfqNS
.
CharacterCount
.
initialize
();
QfqNS
.
CharacterCount
.
initialize
();
};
};
...
...
mockup/fabric.html
View file @
7f1e4e84
...
@@ -77,8 +77,7 @@
...
@@ -77,8 +77,7 @@
QfqNS
.
Log
.
level
=
0
;
QfqNS
.
Log
.
level
=
0
;
// Just for mockup, init() function called from new QfqNS.Plugin class maybe.
// Just for mockup, init() function called from new QfqNS.Plugin class maybe.
var
qfqFabric
=
new
QfqNS
.
Fabric
();
qfqFabric
.
initialize
(
$
(
"
.fabric
"
));
});
});
</script>
</script>
</body>
</body>
...
...
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