Commit 230dd88a by Calen Pennington

Add global methods used by video module to CMS

parent 2d570f7c
jQuery.postWithPrefix = (url, data, callback, type) ->
$.post("#{CMS.prefix}#{url}", data, callback, type)
jQuery.getWithPrefix = (url, data, callback, type) ->
$.get("#{CMS.prefix}#{url}", data, callback, type)
@CMS =
Models: {}
Views: {}
prefix: $("meta[name='path_prefix']").attr('content')
viewStack: []
start: (el) ->
......@@ -32,4 +40,11 @@ $ ->
$.ajaxSetup
headers : { 'X-CSRFToken': $.cookie 'csrftoken' }
window.onTouchBasedDevice = ->
navigator.userAgent.match /iPhone|iPod|iPad/i
$('body').addClass 'touch-based-device' if onTouchBasedDevice()
CMS.start($('section.main-container'))
......@@ -11,6 +11,8 @@
<link rel="stylesheet" type="text/css" href="${static.url('js/vendor/markitup/sets/wiki/style.css')}" />
<title><%block name="title"></%block></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="path_prefix" content="${MITX_ROOT_URL}">
</head>
<body>
......
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