Hook up js to css classes
This commit is contained in:
@@ -1,4 +1,60 @@
|
||||
<<<<<<< HEAD
|
||||
define(["backbone", "js/views/asset"], function(Backbone, AssetView) {
|
||||
=======
|
||||
"use strict";
|
||||
// This code is temporarily moved out of asset_index.html
|
||||
// to fix AWS pipelining issues. We can move it back after RequireJS is integrated.
|
||||
$(document).ready(function() {
|
||||
$('.uploads .upload-button').bind('click', showUploadModal);
|
||||
$('.upload-modal .close-button').bind('click', hideModal);
|
||||
$('.upload-modal .choose-file-button').bind('click', showFileSelectionMenu);
|
||||
});
|
||||
|
||||
var showUploadModal = function (e) {
|
||||
e.preventDefault();
|
||||
resetUploadModal();
|
||||
// $modal has to be global for hideModal to work.
|
||||
$modal = $('.upload-modal').show();
|
||||
$('.file-input').bind('change', startUpload);
|
||||
$('.upload-modal .file-chooser').fileupload({
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
maxChunkSize: 100 * 1000 * 1000, // 100 MB
|
||||
autoUpload: true,
|
||||
progressall: function(e, data) {
|
||||
var percentComplete = parseInt((100 * data.loaded) / data.total, 10);
|
||||
showUploadFeedback(e, percentComplete);
|
||||
},
|
||||
maxFileSize: 100 * 1000 * 1000, // 100 MB
|
||||
maxNumberofFiles: 100,
|
||||
add: function(e, data) {
|
||||
data.process().done(function () {
|
||||
data.submit();
|
||||
});
|
||||
},
|
||||
done: function(e, data) {
|
||||
displayFinishedUpload(data.result);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$modalCover.show();
|
||||
};
|
||||
|
||||
var showFileSelectionMenu = function(e) {
|
||||
e.preventDefault();
|
||||
$('.file-input').click();
|
||||
};
|
||||
|
||||
var startUpload = function (e) {
|
||||
var file = e.target.value;
|
||||
|
||||
$('.upload-modal h1').html(gettext('Uploading…'));
|
||||
$('.upload-modal .file-name').html(file.substring(file.lastIndexOf("\\") + 1));
|
||||
$('.upload-modal .choose-file-button').hide();
|
||||
$('.upload-modal .progress-bar').removeClass('loaded').show();
|
||||
};
|
||||
>>>>>>> Hook up js to css classes
|
||||
|
||||
var AssetsView = Backbone.View.extend({
|
||||
// takes AssetCollection as model
|
||||
|
||||
@@ -77,17 +77,6 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="item-progresspoint item-progresspoint-unpack has-error">
|
||||
<span class="deco status-visual">
|
||||
<i class="icon-cog"></i>
|
||||
<i class="icon-warning-sign"></i>
|
||||
</span>
|
||||
|
||||
<div class="status-detail">
|
||||
<h3 class="title">${_("Unpacking")}</h3>
|
||||
<p class="copy is-updated">${_("We're sorry something went wrong with the import of your course data. Please try again.")}</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="item-progresspoint item-progresspoint-verify is-not-started">
|
||||
<span class="deco status-visual">
|
||||
@@ -112,16 +101,6 @@
|
||||
<p class="copy">${_("Replacing previous course content with imported content")}</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="item-progresspoint item-progresspoint-success is-not-started">
|
||||
<span class="deco status-visual">
|
||||
<i class="icon-check"></i>
|
||||
</span>
|
||||
|
||||
<div class="status-detail">
|
||||
<h3 class="title">${_("Success")}</h3>
|
||||
<p class="copy">${_("Your imported content has now replaced all other course content")}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user