Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
92e9d87c
Commit
92e9d87c
authored
Aug 23, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
45f516cd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
17 deletions
+36
-17
lms/static/js/form.ext.js
+26
-17
lms/static/js/jQuery.validity.min.js
+0
-0
lms/templates/signup_modal.html
+10
-0
No files found.
lms/static/js/form.ext.js
View file @
92e9d87c
...
...
@@ -4,26 +4,35 @@
ajax
:
function
(
options
)
{
return
$
.
ajax
(
options
);
},
fire
:
function
(
obj
,
name
,
data
)
{
var
event
=
$
.
Event
(
name
);
obj
.
trigger
(
event
,
data
);
return
event
.
result
!==
false
;
},
handleRemote
:
function
(
element
)
{
var
method
=
element
.
attr
(
'method'
);
var
url
=
element
.
attr
(
'action'
);
var
data
=
element
.
serializeArray
();
var
options
=
{
type
:
method
||
'GET'
,
data
:
data
,
dataType
:
'text json'
,
success
:
function
(
data
,
status
,
xhr
)
{
element
.
trigger
(
"ajax:success"
,
[
data
,
status
,
xhr
]);
},
complete
:
function
(
xhr
,
status
)
{
element
.
trigger
(
"ajax:complete"
,
[
xhr
,
status
]);
},
error
:
function
(
xhr
,
status
,
error
)
{
element
.
trigger
(
"ajax:error"
,
[
xhr
,
status
,
error
]);
if
(
this
.
fire
(
element
,
"ajax:before"
))
{
var
method
=
element
.
attr
(
'method'
);
var
url
=
element
.
attr
(
'action'
);
var
data
=
element
.
serializeArray
();
var
options
=
{
type
:
method
||
'GET'
,
data
:
data
,
dataType
:
'text json'
,
success
:
function
(
data
,
status
,
xhr
)
{
element
.
trigger
(
"ajax:success"
,
[
data
,
status
,
xhr
]);
},
complete
:
function
(
xhr
,
status
)
{
element
.
trigger
(
"ajax:complete"
,
[
xhr
,
status
]);
},
error
:
function
(
xhr
,
status
,
error
)
{
element
.
trigger
(
"ajax:error"
,
[
xhr
,
status
,
error
]);
}
}
if
(
url
)
{
options
.
url
=
url
;
}
return
form_ext
.
ajax
(
options
)
}
else
{
return
false
;
}
if
(
url
)
{
options
.
url
=
url
;
}
return
form_ext
.
ajax
(
options
)
},
CSRFProtection
:
function
(
xhr
)
{
var
token
=
$
.
cookie
(
'csrftoken'
);
...
...
lms/static/js/jQuery.validity.min.js
0 → 100755
View file @
92e9d87c
This diff is collapsed.
Click to expand it.
lms/templates/signup_modal.html
View file @
92e9d87c
...
...
@@ -118,8 +118,18 @@
</div>
</section>
<script
src=
"${static.url('js/jQuery.validity.min.js')}"
></script>
<script
type=
"text/javascript"
>
(
function
()
{
$
(
document
).
delegate
(
'#register_form'
,
'ajax:before'
,
function
()
{
var
username
=
$
(
"input[name=username]"
).
value
();
console
.
log
(
username
)
return
false
;
});
$
(
document
).
delegate
(
'#register_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
...
...
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