Commits

megamahi committed 21ea890

Fixed widget to conform to tests

  • Participants
  • Parent commits 316971a

Comments (0)

Files changed (3)

File tw2/dyntext/static/dyntext.css

Empty file removed.

File tw2/dyntext/templates/dyntext.mak

 <%namespace name="tw" module="tw2.core.mako_util"/>
 <span id="${w.attrs['id']}">${w.initial_text}</span>
-<script type="text/javascript">
-    setupPollingDynText("${w.selector}", ${w.j('data_url')}, ${w.j('interval')});
-</script>

File tw2/dyntext/widgets.py

 from tw2.jquery import jquery_js
 import json
 
+setup_call = twc.js_function('setupPollingDynText')
+
 class DynamicTextWidget(twc.Widget):
     template = "mako:tw2.dyntext.templates.dyntext"
 
 
         super(DynamicTextWidget, self).prepare()
         # put code here to run just before the widget is displayed
-        self.selector = self.attrs['id'].replace(':', '\\\\:')
+        self.selector = self.attrs['id'].replace(':', '\\:')
+        self.add_call(setup_call(self.selector, self.data_url, self.interval))