Commit 8080261a by David Baumgold

generate raw URLs that are not rewritten by static_replace

parent 0c1b045f
...@@ -3,19 +3,19 @@ from staticfiles.storage import staticfiles_storage ...@@ -3,19 +3,19 @@ from staticfiles.storage import staticfiles_storage
from pipeline_mako import compressed_css, compressed_js from pipeline_mako import compressed_css, compressed_js
%> %>
<%def name='url(file)'><% <%def name='url(file, raw=False)'><%
try: try:
url = staticfiles_storage.url(file) url = staticfiles_storage.url(file)
except: except:
url = file url = file
%>${url}</%def> %>${url}${"?raw" if raw else ""}</%def>
<%def name='css(group)'> <%def name='css(group, raw=False)'>
% if settings.FEATURES['USE_DJANGO_PIPELINE']: % if settings.FEATURES['USE_DJANGO_PIPELINE']:
${compressed_css(group)} ${compressed_css(group)}
% else: % else:
% for filename in settings.PIPELINE_CSS[group]['source_filenames']: % for filename in settings.PIPELINE_CSS[group]['source_filenames']:
<link rel="stylesheet" href="${staticfiles_storage.url(filename.replace('.scss', '.css'))}" type="text/css" media="all" / > <link rel="stylesheet" href="${staticfiles_storage.url(filename.replace('.scss', '.css'))}${"?raw" if raw else ""}" type="text/css" media="all" / >
% endfor % endfor
%endif %endif
</%def> </%def>
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='/static_content.html'/>
<%static:css group='style-vendor-tinymce-content'/> <%static:css group='style-vendor-tinymce-content' raw=True />
<%static:css group='style-vendor-tinymce-skin'/> <%static:css group='style-vendor-tinymce-skin' raw=True />
<script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/tinymce.full.min.js')}" /> <script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/tinymce.full.min.js', raw=True)}" />
<script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js')}" /> <script type="text/javascript" src="${static.url('js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js', raw=True)}" />
<div class="annotatable-wrapper"> <div class="annotatable-wrapper">
<div class="annotatable-header"> <div class="annotatable-header">
...@@ -48,9 +48,9 @@ ...@@ -48,9 +48,9 @@
$(this).parents('.annotatable-section:first').find('.annotatable-instructions')[slideMethod](); $(this).parents('.annotatable-section:first').find('.annotatable-instructions')[slideMethod]();
} }
$('.annotatable-toggle-instructions').on('click', onClickHideInstructions); $('.annotatable-toggle-instructions').on('click', onClickHideInstructions);
//Grab uri of the course //Grab uri of the course
var parts = window.location.href.split("/"), var parts = window.location.href.split("/"),
uri = ''; uri = '';
for (var index = 0; index <= 9; index += 1) uri += parts[index]+"/"; //Get the unit url for (var index = 0; index <= 9; index += 1) uri += parts[index]+"/"; //Get the unit url
//Change uri in cms //Change uri in cms
...@@ -67,16 +67,16 @@ ...@@ -67,16 +67,16 @@
optionsAnnotator: { optionsAnnotator: {
permissions:{ permissions:{
user: { user: {
id:"${user.email}", id:"${user.email}",
name:"${user.username}" name:"${user.username}"
}, },
userString: function (user) { userString: function (user) {
if (user && user.name) if (user && user.name)
return user.name; return user.name;
return user; return user;
}, },
userId: function (user) { userId: function (user) {
if (user && user.id) if (user && user.id)
return user.id; return user.id;
return user; return user;
}, },
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
} }
for (_i = 0, _len = tokens.length; _i < _len; _i++) { for (_i = 0, _len = tokens.length; _i < _len; _i++) {
token = tokens[_i]; token = tokens[_i];
if (this.userId(user) === token) { if (this.userId(user) === token) {
return true; return true;
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/"; var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/";
tinymce.baseURL = "${settings.STATIC_URL}" + "js/vendor/tinymce/js/tinymce"; tinymce.baseURL = "${settings.STATIC_URL}" + "js/vendor/tinymce/js/tinymce";
//remove old instances //remove old instances
if (Annotator._instances.length !== 0) { if (Annotator._instances.length !== 0) {
$('#textHolder').annotator("destroy"); $('#textHolder').annotator("destroy");
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
delete ova; delete ova;
//Load the plugin Video/Text Annotation //Load the plugin Video/Text Annotation
var ova = new OpenVideoAnnotation.Annotator($('#textHolder'),options); var ova = new OpenVideoAnnotation.Annotator($('#textHolder'),options);
//Catch //Catch
var annotator = ova.annotator, var annotator = ova.annotator,
catchOptions = { catchOptions = {
......
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