X-Git-Url: http://git.indexdata.com/?p=mkwsxb-moved-to-github.git;a=blobdiff_plain;f=mkwsxb%2Fmkwsxb.py;h=13822ea4eac1c0d14f5281b2821000f351b376a6;hp=6c11a226e0537ad9f8ce9bc9bc06d008d74fbc2c;hb=08dd9d9bbbbc0b190b80e4a3ee93bc4957c13302;hpb=0aa27ab7fe0996efbcfd5a16f994d87b852fd46d diff --git a/mkwsxb/mkwsxb.py b/mkwsxb/mkwsxb.py index 6c11a22..13822ea 100644 --- a/mkwsxb/mkwsxb.py +++ b/mkwsxb/mkwsxb.py @@ -16,6 +16,10 @@ class MKWSXB(XBlock): default="water", scope=Scope.content ) + display_name = String( + default="MKWS Widget", + scope=Scope.settings + ) def resource_string(self, path): """Helper for accessing resources.""" @@ -26,10 +30,11 @@ class MKWSXB(XBlock): """The primary view of the MKWS XBlock, shown to students when viewing courses.""" html = self.resource_string("static/html/mkwsxb.html") frag = Fragment(html.format(query=self.query, team=random.randint(0, 100000))) - frag.add_javascript_url("//mkws.indexdata.com/mkws-complete.js") - frag.add_javascript_url("//example.indexdata.com/mkws-widget-ru.js") - frag.add_css(self.resource_string("static/css/mkws-widget-ru.css")) + # mkwsxb.js uses require.js as it cannot guarantee mkws-complete.js has loaded + # in studio without it + frag.add_javascript_url("/static/js/vendor/require.js"); frag.add_javascript(self.resource_string("static/js/src/mkwsxb.js")) + frag.add_css(self.resource_string("static/css/mkws-widget-ru.css")) frag.initialize_js('MKWSXB') return frag;