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
5118391b
Commit
5118391b
authored
Feb 29, 2016
by
Carsten Rose
Browse files
Merge remote-tracking branch 'origin/raos_work' into Typo3integrated
parents
7a01f6c7
1f95b485
Changes
4
Hide whitespace changes
Inline
Side-by-side
javascript/src/QfqForm.js
View file @
5118391b
...
...
@@ -18,6 +18,7 @@ if (!QfqNS) {
this
.
form
=
new
n
.
Form
(
this
.
formId
);
this
.
bsTabs
=
null
;
this
.
lastButtonPress
=
null
;
this
.
destroyFormUserCallbacks
=
new
n
.
Helper
.
FunctionList
();
this
.
getSaveButton
().
addClass
(
"
disabled
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
...
...
@@ -36,6 +37,36 @@ if (!QfqNS) {
this
.
bsTabs
=
bsTabs
;
};
/**
*
* @param $button
* @param enabled {boolean}
*
* @private
*/
n
.
QfqForm
.
prototype
.
setButtonEnabled
=
function
(
$button
,
enabled
)
{
if
(
!
$button
)
{
n
.
Log
.
error
(
"
QfqForm#setButtonEnabled(): no button provided.
"
);
return
;
}
if
(
!
enabled
)
{
$button
.
addClass
(
"
disabled
"
);
$button
.
attr
(
"
disabled
"
,
"
disabled
"
);
}
else
{
$button
.
removeClass
(
"
disabled
"
);
$button
.
removeAttr
(
"
disabled
"
);
}
};
/**
* @private
*/
n
.
QfqForm
.
prototype
.
destroyFormAndSetText
=
function
(
text
)
{
this
.
form
=
null
;
$
(
'
#
'
+
this
.
formId
).
replaceWith
(
$
(
"
<p>
"
).
append
(
text
));
this
.
destroyFormUserCallbacks
.
call
();
};
/**
* @private
*/
...
...
@@ -124,6 +155,12 @@ if (!QfqNS) {
* @private
*/
n
.
QfqForm
.
prototype
.
handleDeleteSuccess
=
function
(
data
)
{
this
.
setButtonEnabled
(
this
.
getCloseButton
(),
false
);
this
.
setButtonEnabled
(
this
.
getDeleteButton
(),
false
);
this
.
setButtonEnabled
(
this
.
getSaveButton
(),
false
);
this
.
setButtonEnabled
(
this
.
getNewButton
(),
false
);
this
.
destroyFormAndSetText
(
"
Record has been deleted!
"
);
if
(
!
data
.
redirect
||
data
.
redirect
===
"
client
"
)
{
window
.
history
.
back
();
return
;
...
...
javascript/src/QfqPage.js
View file @
5118391b
...
...
@@ -45,12 +45,21 @@ if (!QfqNS) {
try
{
this
.
qfqForm
=
new
QfqNS
.
QfqForm
(
this
.
settings
.
formId
,
this
.
settings
.
submitTo
,
this
.
settings
.
deleteUrl
);
this
.
qfqForm
.
setBsTabs
(
this
.
bsTabs
);
this
.
qfqForm
.
destroyFormUserCallbacks
.
addFunction
(
this
.
destroyFormHandler
.
bind
(
this
));
}
catch
(
e
)
{
QfqNS
.
Log
.
error
(
e
.
message
);
this
.
qfqForm
=
null
;
}
};
/**
* @private
*/
n
.
QfqPage
.
prototype
.
destroyFormHandler
=
function
()
{
this
.
settings
.
qfqForm
=
null
;
$
(
'
#
'
+
this
.
settings
.
tabsId
).
remove
();
};
n
.
QfqPage
.
prototype
.
tabShowHandler
=
function
(
bsTabs
)
{
// tabShowHandler will be called every time the tab will be shown, regardless of whether or not this happens
// because of BSTabs.activateTab() or user interaction.
...
...
mockup/posttarget.html
0 → 100644
View file @
5118391b
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Post Target
</title>
</head>
<body>
<p>
Form submitted
</p>
</body>
</html>
\ No newline at end of file
mockup/submitform.html
0 → 100644
View file @
5118391b
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Submit Form
</title>
</head>
<body>
<form
action=
"posttarget.html"
>
<input
type=
"text"
name=
"input a"
>
<input
type=
"submit"
name=
"Submit"
value=
"Submit"
>
</form>
</body>
</html>
\ No newline at end of file
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