| {% raw %}
// The template to display files available for upload
script#template-upload(type="text/x-tmpl").
| {% for (var i=0, file; file=o.files[i]; i++) { %}
{%=file.name%}
Processing...
{% if (!i && !o.options.autoUpload) { %}
{% } %}
{% if (!i) { %}
{% } %}
| {% } %}
// The template to display files available for download
script#template-download(type="text/x-tmpl").
| {% for (var i=0, file; file=o.files[i]; i++) { %}
{% if (file.thumbnailUrl) { %}
{% } %}
{% if (file.url) { %}
{%=file.name%}
{% } else { %}
{%=file.name%}
{% } %}
{% if (file.error) { %}
Error {%=file.error%}
{% } %}
{%=o.formatFileSize(file.size)%}
{% if (file.deleteUrl) { %}
Create
{% } else { %}
{% } %}
| {% } %}
| {% endraw %}
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.iframe-transport.min.js') }}")
script(src="{{ url_for('static_pillar', filename='javascript-templates/js/tmpl.min.js') }}")
script(src="{{ url_for('static_pillar', filename='javascript-load-image/js/load-image.all.min.js') }}")
script(src="{{ url_for('static_pillar', filename='javascript-canvas-to-blob/js/canvas-to-blob.min.js') }}")
script(src="{{ url_for('static_pillar', filename='gallery/js/jquery.blueimp-gallery.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.iframe-transport.min.js') }}")
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.fileupload.min.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/jquery.fileupload-process.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/jquery.fileupload-image.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/jquery.fileupload-audio.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/jquery.fileupload-video.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/jquery.fileupload-validate.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/jquery.fileupload-ui.js') }}")
script(src="{{ url_for('static_pillar', filename='jquery-file-upload/js/main.js') }}")
script().
$('body').unbind('click');
$('body').on('click', '.create', function(event) {
// Start the asset creation process
event.preventDefault();
var parent_id = ProjectUtils.nodeId();
$('#node-add-form').text('Please wait...');
$.post('{{url_for('nodes.assets_create')}}', {
name: $(this).attr('data-name'),
project_id: ProjectUtils.projectId(),
type: $(this).attr('data-type'),
parent_id: parent_id})
.done(function(data) {
if (parent_id) {
// We are in embedded mode and try to call the editNode function
editNode(data.asset_id);
} else {
window.location.replace("/nodes/" + data.asset_id + "/edit");
}
//alert( "Data Loaded: " + data.message );
});
});
// Temporary list of CSS to style the upload form
var cssLinks = ['/static/assets/css/blueimp/blueimp-gallery.min.css',
'/static/jquery-file-upload/css/jquery.fileupload.css',
'/static/jquery-file-upload/css/jquery.fileupload-ui.css']
$.each(cssLinks, function(index, value) {
// Check if the CSS is needed
if (!$("link[href='" + value + "']").length) {
$('').appendTo("head");
}
});