Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
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
django-rest-framework
Commits
e8ff5e26
Commit
e8ff5e26
authored
May 12, 2017
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Javascript fixes for API docs
parent
63a40214
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
rest_framework/static/rest_framework/docs/js/api.js
+13
-11
rest_framework/templates/rest_framework/docs/index.html
+1
-1
No files found.
rest_framework/static/rest_framework/docs/js/api.js
View file @
e8ff5e26
...
@@ -23,7 +23,7 @@ function formEntries (form) {
...
@@ -23,7 +23,7 @@ function formEntries (form) {
// Polyfill for new FormData(form).entries()
// Polyfill for new FormData(form).entries()
var
formData
=
new
FormData
(
form
)
var
formData
=
new
FormData
(
form
)
if
(
formData
.
entries
!==
undefined
)
{
if
(
formData
.
entries
!==
undefined
)
{
return
formData
.
entries
(
)
return
Array
.
from
(
formData
.
entries
()
)
}
}
var
entries
=
[]
var
entries
=
[]
...
@@ -59,6 +59,8 @@ $(function () {
...
@@ -59,6 +59,8 @@ $(function () {
var
$selectedAuthentication
=
$
(
'#selected-authentication'
)
var
$selectedAuthentication
=
$
(
'#selected-authentication'
)
var
$authControl
=
$
(
'#auth-control'
)
var
$authControl
=
$
(
'#auth-control'
)
var
$authTokenModal
=
$
(
'#auth_token_modal'
)
var
$authTokenModal
=
$
(
'#auth_token_modal'
)
var
$authBasicModal
=
$
(
'#auth_basic_modal'
)
var
$authSessionModal
=
$
(
'#auth_session_modal'
)
// Language Control
// Language Control
$
(
'#language-control li'
).
click
(
function
(
event
)
{
$
(
'#language-control li'
).
click
(
function
(
event
)
{
...
@@ -260,8 +262,8 @@ $(function () {
...
@@ -260,8 +262,8 @@ $(function () {
event
.
preventDefault
()
event
.
preventDefault
()
window
.
auth
=
null
window
.
auth
=
null
$selectedAuthentication
.
text
(
'none'
)
$selectedAuthentication
.
text
(
'none'
)
$authControl
.
children
(
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth]"
).
closest
(
'li'
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth='none']"
).
addClass
(
'active'
)
$authControl
.
find
(
"[data-auth='none']"
).
closest
(
'li'
).
addClass
(
'active'
)
})
})
// Authentication: token
// Authentication: token
...
@@ -276,8 +278,8 @@ $(function () {
...
@@ -276,8 +278,8 @@ $(function () {
'token'
:
token
'token'
:
token
}
}
$selectedAuthentication
.
text
(
'token'
)
$selectedAuthentication
.
text
(
'token'
)
$authControl
.
children
(
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth]"
).
closest
(
'li'
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth='token']"
).
addClass
(
'active'
)
$authControl
.
find
(
"[data-auth='token']"
).
closest
(
'li'
).
addClass
(
'active'
)
$authTokenModal
.
modal
(
'hide'
)
$authTokenModal
.
modal
(
'hide'
)
})
})
...
@@ -293,9 +295,9 @@ $(function () {
...
@@ -293,9 +295,9 @@ $(function () {
'password'
:
password
'password'
:
password
}
}
$selectedAuthentication
.
text
(
'basic'
)
$selectedAuthentication
.
text
(
'basic'
)
$authControl
.
children
(
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth]"
).
closest
(
'li'
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth='basic']"
).
addClass
(
'active'
)
$authControl
.
find
(
"[data-auth='basic']"
).
closest
(
'li'
).
addClass
(
'active'
)
$auth
Token
Modal
.
modal
(
'hide'
)
$auth
Basic
Modal
.
modal
(
'hide'
)
})
})
// Authentication: session
// Authentication: session
...
@@ -305,8 +307,8 @@ $(function () {
...
@@ -305,8 +307,8 @@ $(function () {
'type'
:
'session'
'type'
:
'session'
}
}
$selectedAuthentication
.
text
(
'session'
)
$selectedAuthentication
.
text
(
'session'
)
$authControl
.
children
(
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth]"
).
closest
(
'li'
).
removeClass
(
'active'
)
$authControl
.
find
(
"[data-auth='session']"
).
addClass
(
'active'
)
$authControl
.
find
(
"[data-auth='session']"
).
closest
(
'li'
).
addClass
(
'active'
)
$auth
Toke
nModal
.
modal
(
'hide'
)
$auth
Sessio
nModal
.
modal
(
'hide'
)
})
})
})
})
rest_framework/templates/rest_framework/docs/index.html
View file @
e8ff5e26
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
};
};
$
(
'#selected-authentication'
).
text
(
'session'
);
$
(
'#selected-authentication'
).
text
(
'session'
);
$
(
'#auth-control'
).
children
().
removeClass
(
'active'
);
$
(
'#auth-control'
).
children
().
removeClass
(
'active'
);
$
(
'#auth-control'
).
find
(
"[data-auth='session']"
).
addClass
(
'active'
);
$
(
'#auth-control'
).
find
(
"[data-auth='session']"
).
closest
(
'li'
).
addClass
(
'active'
);
{
%
endif
%
}
{
%
endif
%
}
</script>
</script>
</body>
</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