Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fsfahrttool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sarah Kleest-Meißner
fsfahrttool
Commits
bf312166
Commit
bf312166
authored
9 years ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
added needed props to storyboard; some more API
parent
c759154c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
registration-system/view/js/api.js
+43
-11
43 additions, 11 deletions
registration-system/view/js/api.js
registration-system/view/signups/game1/STORYBOARD.md
+4
-1
4 additions, 1 deletion
registration-system/view/signups/game1/STORYBOARD.md
with
47 additions
and
12 deletions
registration-system/view/js/api.js
+
43
−
11
View file @
bf312166
...
@@ -84,7 +84,7 @@ function Bachelor() {
...
@@ -84,7 +84,7 @@ function Bachelor() {
}
}
function
FAPI
()
{
function
FAPI
()
{
var
bachelor
=
new
Bachelor
();
this
.
data
=
new
Bachelor
();
this
.
methodBasepath
=
'
view/signups/
'
+
UrlComponents
.
getValueOf
(
'
method
'
)
+
'
/
'
;
this
.
methodBasepath
=
'
view/signups/
'
+
UrlComponents
.
getValueOf
(
'
method
'
)
+
'
/
'
;
}
}
...
@@ -93,21 +93,17 @@ FAPI.prototype.resolvePath = function(file) {
...
@@ -93,21 +93,17 @@ FAPI.prototype.resolvePath = function(file) {
};
};
/**
/**
*
* params to send have to be set earlier (see the Bachelor)
* params will contain the attributes to send (as an object)
* -> will be defined later
*
*
* callback is called, once the request was sent to the server.
* callback is called, once the request was sent to the server.
* It'll transmit an object containing the
* It'll transmit an object containing the
* -> state (0 = successful, 1 = error, 2 = ?)
* -> state (0 = successful, 1 = error, 2 = ?)
* -> main message (string)
* -> main message (string)
* -> errors (null, if non; array of strings with messages else)
* -> errors (null, if non; array of strings with messages else)
*
* @param params
* @param callback
* @param callback
*/
*/
function
api_send_signup
(
params
,
callback
)
{
FAPI
.
prototype
.
submitSignup
=
function
(
callback
)
{
// TODO evaluate params and send them
// TODO evaluate params and send them
callback
({
callback
({
...
@@ -115,9 +111,45 @@ function api_send_signup(params, callback) {
...
@@ -115,9 +111,45 @@ function api_send_signup(params, callback) {
messages
:
'
Successful signup
'
,
messages
:
'
Successful signup
'
,
errors
:
null
errors
:
null
})
})
}
};
/**
* Helper function for FAPI.prototype.submitSignup
* it creates a hidden form to be submitted.
*/
FAPI
.
prototype
.
prepareSubmission
=
function
()
{
var
formWrapper
=
$
(
'
<div style="display:none"/>
'
);
var
form
=
$
(
'
<form name="storySubmitForm" method="POST"/>
'
);
formWrapper
.
append
(
form
);
$
(
'
#signup-container
'
).
append
(
formWrapper
);
function
formAppendText
(
name
,
value
)
{
form
.
append
(
'
<input name="
'
+
name
+
'
" value="
'
+
value
.
replace
(
/
[\r\n]
/g
,
"
<br/>
"
).
replace
(
/&/g
,
"
&
"
).
replace
(
/"/g
,
"
"
"
)
+
'
"/>
'
);
}
function
api_soft_protect
(
elementIds
,
regex
)
{
if
(
window
.
location
.
pathname
.
search
(
"
waitlist
"
)
>
0
)
formAppendText
(
"
waitlist
"
,
"
waitlist
"
);
formAppendText
(
'
forname
'
,
story
.
form_variables
.
forname
);
formAppendText
(
'
sirname
'
,
story
.
form_variables
.
name
);
formAppendText
(
'
pseudo
'
,
story
.
form_variables
.
anzeig
);
formAppendText
(
'
mehl
'
,
story
.
form_variables
.
mehl
);
formAppendText
(
'
studityp
'
,
$
(
'
#story_summary_studityp
'
).
val
());
formAppendText
(
'
virgin
'
,
Story
.
ageMap
[
story
.
form_variables
.
age
]);
formAppendText
(
'
essen
'
,
Story
.
eatMapPhp
[
Story
.
eatMap
[
story
.
form_variables
.
eat
]]);
formAppendText
(
'
anday
'
,
story
.
form_variables
.
travelStartDate
);
formAppendText
(
'
antyp
'
,
Story
.
travelMapPhp
[
Story
.
travelMap
[
story
.
form_variables
.
travelStartType
]]);
formAppendText
(
'
abday
'
,
story
.
form_variables
.
travelEndDate
);
formAppendText
(
'
abtyp
'
,
Story
.
travelMapPhp
[
Story
.
travelMap
[
story
.
form_variables
.
travelEndType
]]);
formAppendText
(
'
comment
'
,
$
(
'
#story_summary_comment
'
).
val
());
if
(
$
(
'
#story_summary_public
'
).
is
(
'
:checked
'
))
formAppendText
(
'
public
'
,
'
public
'
);
formAppendText
(
'
captcha
'
,
$
(
'
#story_summary_captcha
'
).
val
());
formAppendText
(
'
storySubmit
'
,
'
storySubmit
'
);
form
.
submit
();
};
FAPI
.
prototype
.
attachSoftProtector
=
function
(
elementIds
,
regex
)
{
for
(
var
i
=
0
;
i
<
elementIds
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
elementIds
.
length
;
++
i
)
{
$
(
'
#
'
+
elementIds
[
i
]).
keyup
(
function
(
event
)
{
$
(
'
#
'
+
elementIds
[
i
]).
keyup
(
function
(
event
)
{
if
(
!
event
.
target
.
value
.
match
(
regex
))
if
(
!
event
.
target
.
value
.
match
(
regex
))
...
@@ -126,5 +158,5 @@ function api_soft_protect(elementIds, regex) {
...
@@ -126,5 +158,5 @@ function api_soft_protect(elementIds, regex) {
event
.
target
.
style
.
backgroundColor
=
"
#fff
"
;
event
.
target
.
style
.
backgroundColor
=
"
#fff
"
;
});
});
}
}
}
}
;
This diff is collapsed.
Click to expand it.
registration-system/view/signups/game1/STORYBOARD.md
+
4
−
1
View file @
bf312166
...
@@ -4,10 +4,13 @@
...
@@ -4,10 +4,13 @@
-
Anreise Art
-
Anreise Art
-
Abreise Tag
-
Abreise Tag
-
Abreise Art
-
Abreise Art
-
Alter
-
Alter
(18+ ja/nein)
-
Essen
-
Essen
-
Name (Vor und Nachname einzeln)
-
Name (Vor und Nachname einzeln)
-
E-Mail
-
Kommentar
-
Kommentar
-
Ersti/Tutor/Hörsti
-
Anmeldung verstecken (ja/nein)
# Eastereggs
# Eastereggs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment