collaboration editor update fix, use closure for compression
This commit is contained in:
parent
88fdf6b2ca
commit
ccbf8336ea
9 changed files with 1313 additions and 86 deletions
|
@ -103,37 +103,6 @@
|
|||
{% assets "js_common" %}
|
||||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
<script>
|
||||
hljs.initHighlightingOnLoad();
|
||||
|
||||
// Markdown Renderer
|
||||
MDR = {
|
||||
doc: null,
|
||||
callback: WMD.convert,
|
||||
convert: function(md, sanitize){
|
||||
this.doc = this.callback(md);
|
||||
var html = this.doc.html;
|
||||
if (sanitize) {
|
||||
// Causes some problems with inline styles
|
||||
html = html_sanitize(html);
|
||||
}
|
||||
html = this.hook(html);
|
||||
return html;
|
||||
},
|
||||
hook: function(html) {
|
||||
if (!this.doc.metadata) {
|
||||
return html;
|
||||
}
|
||||
try {
|
||||
var template = Handlebars.compile(html);
|
||||
return template(this.doc.metadata);
|
||||
} catch(e) {
|
||||
return html;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
{% block js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
||||
{% endassets %}
|
||||
<script>
|
||||
$(function(){
|
||||
$("#start-togetherjs").click(function(){
|
||||
$(this).prop('disabled', true).html("Loading");
|
||||
});
|
||||
});
|
||||
TogetherJSConfig_toolName = "Collaboration";
|
||||
TogetherJSConfig_suppressJoinConfirmation = true;
|
||||
TogetherJSConfig_getUserName = function () {
|
||||
|
@ -15,12 +20,12 @@
|
|||
};
|
||||
|
||||
TogetherJSConfig_on_ready = function () {
|
||||
//$("#start-togetherjs").addClass('btn-danger').html($(this).data('end-togetherjs-html'));
|
||||
$("#start-togetherjs").addClass('btn-danger').html('End Collaboration');
|
||||
|
||||
MDR.sanitize = true;
|
||||
$("#start-togetherjs").addClass('btn-danger').html('End Collaboration').prop('disabled', false);
|
||||
};
|
||||
TogetherJSConfig_on_close = function () {
|
||||
$("#start-togetherjs").removeClass('btn-danger').html('Collaborate')
|
||||
MDR.sanitize = null;
|
||||
$("#start-togetherjs").removeClass('btn-danger').html('Collaborate').prop('disabled', false);
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue