Difficulty selectbox in Studio (based on new XBlockAside functionality). Include:

- adaptation asides to be imported from the XML
- updating SplitMongo to handle XBlockAsides (CRUD operations)
- updating Studio to handle XBlockAsides handler calls
- updating xblock/core.js to properly init XBlockAsides JavaScript
This commit is contained in:
Dmitry Viskov
2016-02-15 22:38:09 +03:00
parent d481768571
commit 209ddc700d
23 changed files with 1135 additions and 110 deletions

View File

@@ -0,0 +1,40 @@
(function($) {
'use strict';
function StructuredTagsView(runtime, element) {
var $element = $(element);
$element.find("select").each(function() {
var loader = this;
var sts = $(this).attr('structured-tags-select-init');
if (typeof sts === typeof undefined || sts === false) {
$(this).attr('structured-tags-select-init', 1);
$(this).change(function(e) {
e.preventDefault();
var selectedKey = $(loader).find('option:selected').val();
runtime.notify('save', {
state: 'start',
element: element,
message: gettext('Updating Tags')
});
$.post(runtime.handlerUrl(element, 'save_tags'), {
'tag': $(loader).attr('name') + ':' + selectedKey
}).done(function() {
runtime.notify('save', {
state: 'end',
element: element
});
});
});
}
});
}
function initializeStructuredTags(runtime, element) {
return new StructuredTagsView(runtime, element);
}
window.StructuredTagsInit = initializeStructuredTags;
})($);