Commit 85b79fe4 authored by SohanDanushka's avatar SohanDanushka

Committing LectureAssets rest_framework

parent cba7c15c
This diff is collapsed.
/*
This CSS file contains some tweaks specific to the included Bootstrap theme.
It's separate from `style.css` so that it can be easily overridden by replacing
a single block in the template.
*/
.form-actions {
background: transparent;
border-top-color: transparent;
padding-top: 0;
text-align: right;
}
#generic-content-form textarea {
font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace;
font-size: 80%;
}
.navbar-inverse .brand a {
color: #999999;
}
.navbar-inverse .brand:hover a {
color: white;
text-decoration: none;
}
/* custom navigation styles */
.navbar {
width: 100%;
position: fixed;
left: 0;
top: 0;
}
.navbar {
background: #2C2C2C;
color: white;
border: none;
border-top: 5px solid #A30000;
border-radius: 0px;
}
.navbar .nav li, .navbar .nav li a, .navbar .brand:hover {
color: white;
}
.nav-list > .active > a, .nav-list > .active > a:hover {
background: #2C2C2C;
}
.navbar .dropdown-menu li a, .navbar .dropdown-menu li {
color: #A30000;
}
.navbar .dropdown-menu li a:hover {
background: #EEEEEE;
color: #C20000;
}
ul.breadcrumb {
margin: 70px 0 0 0;
}
.breadcrumb li.active a {
color: #777;
}
.pagination>.disabled>a,
.pagination>.disabled>a:hover,
.pagination>.disabled>a:focus {
cursor: not-allowed;
pointer-events: none;
}
.pager>.disabled>a,
.pager>.disabled>a:hover,
.pager>.disabled>a:focus {
pointer-events: none;
}
.pager .next {
margin-left: 10px;
}
/*=== dabapps bootstrap styles ====*/
html {
width:100%;
background: none;
}
/*body, .navbar .container-fluid {
max-width: 1150px;
margin: 0 auto;
}*/
body {
background: url("../img/grid.png") repeat-x;
background-attachment: fixed;
}
#content {
margin: 0;
padding-bottom: 60px;
}
/* sticky footer and footer */
html, body {
height: 100%;
}
.wrapper {
position: relative;
top: 0;
left: 0;
padding-top: 60px;
margin: -60px 0;
min-height: 100%;
}
.form-switcher {
margin-bottom: 0;
}
.well {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.well .form-actions {
padding-bottom: 0;
margin-bottom: 0;
}
.well form {
margin-bottom: 0;
}
.nav-tabs {
border: 0;
}
.nav-tabs > li {
float: right;
}
.nav-tabs li a {
margin-right: 0;
}
.nav-tabs > .active > a {
background: #F5F5F5;
}
.nav-tabs > .active > a:hover {
background: #F5F5F5;
}
.tabbable.first-tab-active .tab-content {
border-top-right-radius: 0;
}
footer {
position: absolute;
bottom: 0;
left: 0;
clear: both;
z-index: 10;
height: 60px;
width: 95%;
margin: 0 2.5%;
}
footer p {
text-align: center;
color: gray;
border-top: 1px solid #DDDDDD;
padding-top: 10px;
}
footer a {
color: gray !important;
font-weight: bold;
}
footer a:hover {
color: gray;
}
.page-header {
border-bottom: none;
padding-bottom: 0px;
margin: 0;
}
/* custom general page styles */
.hero-unit h1, .hero-unit h2 {
color: #A30000;
}
body a {
color: #A30000;
}
body a:hover {
color: #c20000;
}
.request-info {
clear:both;
}
.horizontal-checkbox label {
padding-top: 0;
}
.horizontal-checkbox label {
padding-top: 0 !important;
}
.horizontal-checkbox input {
float: left;
width: 20px;
margin-top: 3px;
}
.modal-footer form {
margin-left: 5px;
margin-right: 5px;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/* The navbar is fixed at >= 980px wide, so add padding to the body to prevent
content running up underneath it. */
h1 {
font-weight: 300;
}
h2, h3 {
font-weight: 300;
}
.resource-description, .response-info {
margin-bottom: 2em;
}
.version:before {
content: "v";
opacity: 0.6;
padding-right: 0.25em;
}
.version {
font-size: 70%;
}
.format-option {
font-family: Menlo, Consolas, "Andale Mono", "Lucida Console", monospace;
}
.button-form {
float: right;
margin-right: 1em;
}
td.nested {
padding: 0 !important;
}
td.nested > table {
margin: 0;
}
form select, form input, form textarea {
width: 90%;
}
form select[multiple] {
height: 150px;
}
/* To allow tooltips to work on disabled elements */
.disabled-tooltip-shield {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.errorlist {
margin-top: 0.5em;
}
pre {
overflow: auto;
word-wrap: normal;
white-space: pre;
font-size: 12px;
}
.page-header {
border-bottom: none;
padding-bottom: 0px;
}
#filtersModal form input[type=submit] {
width: auto;
}
#filtersModal .modal-body h2 {
margin-top: 0
}
This diff is collapsed.
.com { color: #93a1a1; }
.lit { color: #195f91; }
.pun, .opn, .clo { color: #93a1a1; }
.fun { color: #dc322f; }
.str, .atv { color: #D14; }
.kwd, .prettyprint .tag { color: #1e347b; }
.typ, .atn, .dec, .var { color: teal; }
.pln { color: #48484c; }
.prettyprint {
padding: 8px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
.prettyprint.linenums {
-webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
-moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin: 0 0 0 33px; /* IE indents via margin-left */
}
ol.linenums li {
padding-left: 12px;
color: #bebec5;
line-height: 20px;
text-shadow: 0 1px 0 #fff;
}
\ No newline at end of file
h1 {
font-size: 45px;
}
.intro-code {
margin-top: 20px;
}
pre.highlight code * {
white-space: nowrap; // this sets all children inside to nowrap
}
pre.highlight {
overflow-x: auto; // this sets the scrolling in x
}
pre.highlight code {
white-space: pre; // forces <code> to respect <pre> formatting
}
.main-container {
padding-left: 30px;
padding-right: 30px;
}
.btn:focus,
.btn:focus:active {
outline: none;
}
.sidebar {
overflow: auto;
font-family: verdana, sans-serif;
font-size: 12px;
font-weight: 200;
background-color: #2e353d;
position: fixed;
top: 0px;
width: 225px;
height: 100%;
color: #FFF;
}
.sidebar .brand {
background-color: #23282e;
display: block;
text-align: center;
padding: 25px 0;
margin-top: 0;
margin-bottom: 0;
}
.sidebar .brand a {
color: #FFF;
}
.sidebar .brand a:hover,
.sidebar .brand a:active,
.sidebar .brand a:focus {
text-decoration: none;
}
.sidebar .toggle-btn {
display: none;
}
.sidebar .menu-list {
width: inherit;
}
.sidebar .menu-list ul,
.sidebar .menu-list li {
background: #2e353d;
list-style: none;
padding: 0px;
margin: 0px;
line-height: 35px;
cursor: pointer;
}
.sidebar .menu-list ul :not(collapsed) .arrow:before,
.sidebar .menu-list li :not(collapsed) .arrow:before {
font-family: FontAwesome;
content: "\f078";
display: inline-block;
padding-left: 10px;
padding-right: 10px;
vertical-align: middle;
float: right;
}
.sidebar .menu-list ul .active,
.sidebar .menu-list li .active {
border-left: 3px solid #d19b3d;
background-color: #4f5b69;
}
.sidebar .menu-list ul .sub-menu li.active,
.sidebar .menu-list li .sub-menu li.active {
color: #d19b3d;
}
.sidebar .menu-list ul .sub-menu li.active a,
.sidebar .menu-list li .sub-menu li.active a {
color: #d19b3d;
}
.sidebar .menu-list ul .sub-menu li,
.sidebar .menu-list li .sub-menu li {
background-color: #181c20;
border: none;
border-bottom: 1px solid #23282e;
margin-left: 0px;
line-height: 1.4;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 10px;
padding-left: 25px;
}
.sidebar .menu-list ul .sub-menu li:hover,
.sidebar .menu-list li .sub-menu li:hover {
background-color: #020203;
}
.sidebar .menu-list ul .sub-menu li a,
.sidebar .menu-list li .sub-menu li a {
display: block;
}
.sidebar .menu-list ul .sub-menu li a:before,
.sidebar .menu-list li .sub-menu li a:before {
font-family: FontAwesome;
font-size: 14px;
font-weight: bold;
content: "\f105";
display: inline;
vertical-align: middle;
padding-left: 0;
padding-right: 7px;
margin-left: -12px;
}
.sidebar .menu-list li {
padding-left: 0px;
border-left: 3px solid #2e353d;
border-bottom: 1px solid #23282e;
}
.sidebar .menu-list li a {
text-decoration: none;
color: white;
}
.sidebar .menu-list li a i {
padding-left: 10px;
width: 20px;
padding-right: 20px;
}
.sidebar .menu-list li:hover {
border-left: 3px solid #d19b3d;
background-color: #4f5b69;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.sidebar #menu-content {
padding-bottom: 70px;
}
body {
margin: 0px;
padding: 0px;
}
.coredocs-section-title {
margin-top: 20px;
padding-bottom: 10px;
border-bottom: 1px solid lightgrey;
}
.coredocs-link-title a,
.coredocs-section-title a {
display: none;
}
.coredocs-link-title a,
.coredocs-section-title a {
text-decoration: none;
}
.coredocs-link-title:hover a,
.coredocs-section-title:hover a {
display: inline;
font-size: 20px;
}
.coredocs-section-title:last-child {
margin-top: 0;
}
/* @group Language Switcher */
.sidebar .menu-list.menu-list-bottom {
margin-bottom: 0;
position: fixed;
width: inherit;
bottom: 0;
left: 0;
right: 0;
border-top: 1px solid #23282e;
}
.sidebar .menu-list-bottom li span {
float: right;
margin-right: 20px;
color: #d19b3d;
}
/* @end Language Switcher */
/* @group Docs Content */
.docs-content .meta .label {
vertical-align: middle;
font-size: 14px;
font-weight: normal;
}
.docs-content .meta code {
vertical-align: middle;
padding: .2em .6em .3em;
font-size: 14px;
}
.docs-content .btn {
font-size: inherit;
}
.code-samples pre {
margin-top: 20px;
}
/* @end Docs Content */
@media (max-width: 767px) {
.main-container {
padding-left: 15px;
padding-right: 15px;
}
.sidebar {
position: relative;
width: 100%;
margin-bottom: 10px;
overflow: visible;
}
.sidebar .toggle-btn {
display: block;
cursor: pointer;
position: absolute;
right: 10px;
top: 10px;
z-index: 10 !important;
padding: 3px;
width: 40px;
text-align: center;
}
.sidebar .menu-list.menu-list-bottom {
position: static;
}
.sidebar .brand {
margin-top: 0;
margin-bottom: 0;
text-align: left !important;
font-size: 22px;
padding: 0;
padding-left: 20px;
line-height: 50px !important;
}
}
@media (min-width: 767px) {
.sidebar .menu-list .menu-content {
display: block;
}
#main {
width:calc(100% - 225px);
float: right;
}
}
@media (min-width: 992px) {
.modal-lg {
width: 980px;
}
}
.api-modal .modal-title .fa {
color: #93c54b;
}
.api-modal .modal-body .request-awaiting {
padding: 35px 10px;
color: #7F8177;
text-align: center;
}
.api-modal .modal-body .meta {
margin-bottom: 20px;
}
.api-modal .modal-body .meta .label {
vertical-align: middle;
font-size: 14px;
font-weight: normal;
}
.api-modal .modal-body .meta code {
vertical-align: middle;
padding: .2em .6em .3em;
font-size: 14px;
}
.api-modal .modal-content .toggle-view {
text-align: right;
float: right;
}
.api-modal .modal-content .response .well {
margin: 0;
max-height: 550px;
}
.highlight {
background-color: #f7f7f9
}
.checkbox label.control-label {
font-weight: bold
}
@media (min-width: 768px) {
.navbar-nav.navbar-right:last-child {
margin-right: 0 !important;
}
}
/*
This is the GitHub theme for highlight.js
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
-webkit-text-size-adjust: none;
}
.hljs-comment,
.diff .hljs-header,
.hljs-javadoc {
color: #998;
font-style: italic;
}
.hljs-keyword,
.css .rule .hljs-keyword,
.hljs-winutils,
.nginx .hljs-title,
.hljs-subst,
.hljs-request,
.hljs-status {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-hexcolor,
.ruby .hljs-constant {
color: #008080;
}
.hljs-string,
.hljs-tag .hljs-value,
.hljs-phpdoc,
.hljs-dartdoc,
.tex .hljs-formula {
color: #d14;
}
.hljs-title,
.hljs-id,
.scss .hljs-preprocessor {
color: #900;
font-weight: bold;
}
.hljs-list .hljs-keyword,
.hljs-subst {
font-weight: normal;
}
.hljs-class .hljs-title,
.hljs-type,
.vhdl .hljs-literal,
.tex .hljs-command {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-tag .hljs-title,
.hljs-rule .hljs-property,
.django .hljs-tag .hljs-keyword {
color: #000080;
font-weight: normal;
}
.hljs-attribute,
.hljs-variable,
.lisp .hljs-body,
.hljs-name {
color: #008080;
}
.hljs-regexp {
color: #009926;
}
.hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.lisp .hljs-keyword,
.clojure .hljs-keyword,
.scheme .hljs-keyword,
.tex .hljs-special,
.hljs-prompt {
color: #990073;
}
.hljs-built_in {
color: #0086b3;
}
.hljs-preprocessor,
.hljs-pragma,
.hljs-pi,
.hljs-doctype,
.hljs-shebang,
.hljs-cdata {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.diff .hljs-change {
background: #0086b3;
}
.hljs-chunk {
color: #aaa;
}
.json-view{position:relative}
.json-view .collapser{width:20px;height:18px;display:block;position:absolute;left:-1.7em;top:-.2em;z-index:5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYGBgOADE%2F3Hgw0DM4IRHgSsDFOzFInmMAQnY49ONzZRjDFiADT7dMLALiE8y4AGW6LoBAgwAuIkf%2F%2FB7O9sAAAAASUVORK5CYII%3D);background-repeat:no-repeat;background-position:center center;opacity:.5;cursor:pointer}
.json-view .collapsed{-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-khtml-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}
.json-view .bl{display:block;padding-left:20px;margin-left:-20px;position:relative}
.json-view{font-family:monospace}
.json-view ul{list-style-type:none;padding-left:2em;border-left:1px dotted;margin:.3em}
.json-view ul li{position:relative}
.json-view .comments,.json-view .dots{display:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}
.json-view .comments{padding-left:.8em;font-style:italic;color:#888}
.json-view .bool,.json-view .null,.json-view .num,.json-view .undef{font-weight:700;color:#1A01CC}
.json-view .str{color:#800}
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* jquery.json-view - jQuery collapsible JSON plugin
* @version v1.0.0
* @link http://github.com/bazh/jquery.json-view
* @license MIT
*/
!function(e){"use strict";var n=function(n){var a=e("<span />",{"class":"collapser",on:{click:function(){var n=e(this);n.toggleClass("collapsed");var a=n.parent().children(".block"),p=a.children("ul");n.hasClass("collapsed")?(p.hide(),a.children(".dots, .comments").show()):(p.show(),a.children(".dots, .comments").hide())}}});return n&&a.addClass("collapsed"),a},a=function(a,p){var t=e.extend({},{nl2br:!0},p),r=function(e){return e.toString()?e.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):""},s=function(n,a){return e("<span />",{"class":a,html:r(n)})},l=function(a,p){switch(e.type(a)){case"object":p||(p=0);var c=e("<span />",{"class":"block"}),d=Object.keys(a).length;if(!d)return c.append(s("{","b")).append(" ").append(s("}","b"));c.append(s("{","b"));var i=e("<ul />",{"class":"obj collapsible level"+p});return e.each(a,function(a,t){d--;var r=e("<li />").append(s('"',"q")).append(a).append(s('"',"q")).append(": ").append(l(t,p+1));-1===["object","array"].indexOf(e.type(t))||e.isEmptyObject(t)||r.prepend(n()),d>0&&r.append(","),i.append(r)}),c.append(i),c.append(s("...","dots")),c.append(s("}","b")),c.append(1===Object.keys(a).length?s("// 1 item","comments"):s("// "+Object.keys(a).length+" items","comments")),c;case"array":p||(p=0);var d=a.length,c=e("<span />",{"class":"block"});if(!d)return c.append(s("[","b")).append(" ").append(s("]","b"));c.append(s("[","b"));var i=e("<ul />",{"class":"obj collapsible level"+p});return e.each(a,function(a,t){d--;var r=e("<li />").append(l(t,p+1));-1===["object","array"].indexOf(e.type(t))||e.isEmptyObject(t)||r.prepend(n()),d>0&&r.append(","),i.append(r)}),c.append(i),c.append(s("...","dots")),c.append(s("]","b")),c.append(1===a.length?s("// 1 item","comments"):s("// "+a.length+" items","comments")),c;case"string":if(a=r(a),/^(http|https|file):\/\/[^\s]+$/i.test(a))return e("<span />").append(s('"',"q")).append(e("<a />",{href:a,text:a})).append(s('"',"q"));if(t.nl2br){var o=/\n/g;o.test(a)&&(a=(a+"").replace(o,"<br />"))}var u=e("<span />",{"class":"str"}).html(a);return e("<span />").append(s('"',"q")).append(u).append(s('"',"q"));case"number":return s(a.toString(),"num");case"undefined":return s("undefined","undef");case"null":return s("null","null");case"boolean":return s(a?"true":"false","bool")}};return l(a)};return e.fn.jsonView=function(n,p){var t=e(this);if(p=e.extend({},{nl2br:!0},p),"string"==typeof n)try{n=JSON.parse(n)}catch(r){}return t.append(e("<div />",{"class":"json-view"}).append(a(n,p))),t}}(jQuery);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
function replaceDocument(docString) {
var doc = document.open("text/html");
doc.write(docString);
doc.close();
}
function doAjaxSubmit(e) {
var form = $(this);
var btn = $(this.clk);
var method = (
btn.data('method') ||
form.data('method') ||
form.attr('method') || 'GET'
).toUpperCase();
if (method === 'GET') {
// GET requests can always use standard form submits.
return;
}
var contentType =
form.find('input[data-override="content-type"]').val() ||
form.find('select[data-override="content-type"] option:selected').text();
if (method === 'POST' && !contentType) {
// POST requests can use standard form submits, unless we have
// overridden the content type.
return;
}
// At this point we need to make an AJAX form submission.
e.preventDefault();
var url = form.attr('action');
var data;
if (contentType) {
data = form.find('[data-override="content"]').val() || ''
if (contentType === 'multipart/form-data') {
// We need to add a boundary parameter to the header
// We assume the first valid-looking boundary line in the body is correct
// regex is from RFC 2046 appendix A
var boundaryCharNoSpace = "0-9A-Z'()+_,-./:=?";
var boundaryChar = boundaryCharNoSpace + ' ';
var re = new RegExp('^--([' + boundaryChar + ']{0,69}[' + boundaryCharNoSpace + '])[\\s]*?$', 'im');
var boundary = data.match(re);
if (boundary !== null) {
contentType += '; boundary="' + boundary[1] + '"';
}
// Fix textarea.value EOL normalisation (multipart/form-data should use CR+NL, not NL)
data = data.replace(/\n/g, '\r\n');
}
} else {
contentType = form.attr('enctype') || form.attr('encoding')
if (contentType === 'multipart/form-data') {
if (!window.FormData) {
alert('Your browser does not support AJAX multipart form submissions');
return;
}
// Use the FormData API and allow the content type to be set automatically,
// so it includes the boundary string.
// See https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
contentType = false;
data = new FormData(form[0]);
} else {
contentType = 'application/x-www-form-urlencoded; charset=UTF-8'
data = form.serialize();
}
}
var ret = $.ajax({
url: url,
method: method,
data: data,
contentType: contentType,
processData: false,
headers: {
'Accept': 'text/html; q=1.0, */*'
},
});
ret.always(function(data, textStatus, jqXHR) {
if (textStatus != 'success') {
jqXHR = data;
}
var responseContentType = jqXHR.getResponseHeader("content-type") || "";
if (responseContentType.toLowerCase().indexOf('text/html') === 0) {
replaceDocument(jqXHR.responseText);
try {
// Modify the location and scroll to top, as if after page load.
history.replaceState({}, '', url);
scroll(0, 0);
} catch (err) {
// History API not supported, so redirect.
window.location = url;
}
} else {
// Not HTML content. We can't open this directly, so redirect.
window.location = url;
}
});
return ret;
}
function captureSubmittingElement(e) {
var target = e.target;
var form = this;
form.clk = target;
}
$.fn.ajaxForm = function() {
var options = {}
return this
.unbind('submit.form-plugin click.form-plugin')
.bind('submit.form-plugin', options, doAjaxSubmit)
.bind('click.form-plugin', options, captureSubmittingElement);
};
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
function csrfSafeMethod(method) {
// these HTTP methods do not require CSRF protection
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
function sameOrigin(url) {
// test that a given url is a same-origin URL
// url could be relative or scheme relative or absolute
var host = document.location.host; // host + port
var protocol = document.location.protocol;
var sr_origin = '//' + host;
var origin = protocol + sr_origin;
// Allow absolute or scheme relative URLs to same origin
return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
(url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
// or any other URL that isn't scheme relative or absolute i.e relative.
!(/^(\/\/|http:|https:).*/.test(url));
}
var csrftoken = window.drf.csrfToken;
$.ajaxSetup({
beforeSend: function(xhr, settings) {
if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) {
// Send the token to same-origin, relative URLs only.
// Send the token only if the method warrants CSRF protection
// Using the CSRFToken value acquired earlier
xhr.setRequestHeader(window.drf.csrfHeaderName, csrftoken);
}
}
});
$(document).ready(function() {
// JSON highlighting.
prettyPrint();
// Bootstrap tooltips.
$('.js-tooltip').tooltip({
delay: 1000,
container: 'body'
});
// Deal with rounded tab styling after tab clicks.
$('a[data-toggle="tab"]:first').on('shown', function(e) {
$(e.target).parents('.tabbable').addClass('first-tab-active');
});
$('a[data-toggle="tab"]:not(:first)').on('shown', function(e) {
$(e.target).parents('.tabbable').removeClass('first-tab-active');
});
$('a[data-toggle="tab"]').click(function() {
document.cookie = "tabstyle=" + this.name + "; path=/";
});
// Store tab preference in cookies & display appropriate tab on load.
var selectedTab = null;
var selectedTabName = getCookie('tabstyle');
if (selectedTabName) {
selectedTabName = selectedTabName.replace(/[^a-z-]/g, '');
}
if (selectedTabName) {
selectedTab = $('.form-switcher a[name=' + selectedTabName + ']');
}
if (selectedTab && selectedTab.length > 0) {
// Display whichever tab is selected.
selectedTab.tab('show');
} else {
// If no tab selected, display rightmost tab.
$('.form-switcher a:first').tab('show');
}
$(window).on('load', function() {
$('#errorModal').modal('show');
});
});
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment