* fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint line around directives issue * fix: eslint semi rule * fix: eslint newline per chain rule * fix: eslint space infix ops rule * fix: eslint space-in-parens issue * fix: eslint space before function paren issue * fix: eslint space before blocks issue * fix: eslint arrow body style issue * fix: eslint dot-location issue * fix: eslint quotes issue * fix: eslint quote props issue * fix: eslint operator assignment issue * fix: eslint new line after import issue * fix: indent issues * fix: operator assignment issue * fix: all autofixable eslint issues * fix: all react related fixable issues * fix: autofixable eslint issues * chore: remove all template literals * fix: remaining autofixable issues * fix: failing js test
30 lines
998 B
JavaScript
30 lines
998 B
JavaScript
import * as $ from 'jquery';
|
|
import * as _ from 'underscore';
|
|
import * as XBlockInfo from 'js/models/xblock_info';
|
|
import * as PagedContainerPage from 'js/views/pages/paged_container';
|
|
import * as LibraryContainerView from 'js/views/library_container';
|
|
import * as ComponentTemplates from 'js/collections/component_template';
|
|
import * as xmoduleLoader from 'xmodule';
|
|
import './base';
|
|
import 'cms/js/main';
|
|
import 'xblock/cms.runtime.v1';
|
|
|
|
'use strict';
|
|
export default function LibraryFactory(componentTemplates, XBlockInfoJson, options) {
|
|
var main_options = {
|
|
el: $('#content'),
|
|
model: new XBlockInfo(XBlockInfoJson, {parse: true}),
|
|
templates: new ComponentTemplates(componentTemplates, {parse: true}),
|
|
action: 'view',
|
|
viewClass: LibraryContainerView,
|
|
canEdit: true
|
|
};
|
|
|
|
xmoduleLoader.done(function() {
|
|
var view = new PagedContainerPage(_.extend(main_options, options));
|
|
view.render();
|
|
});
|
|
}
|
|
|
|
export {LibraryFactory};
|