def render(self, req, content, new=False): html = """ <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("td").click(paint_square); $("input[name=brush]")[0].checked = true; }); %s </script></head><body>""" % lib_js() if new is True: html += render_addform(req.GET.get('h'), req.GET.get('w')) html += draw(req, content, self.props) html += render_controls(some_colors) html += """ <form method="POST" onsubmit="serialize();"> <input type="hidden" id="resource_body" name="svenweb.resource_body" value="%s"></textarea> <label for="svenweb.commit_message">Commit message</label> <input name="svenweb.commit_message"></input> <input name="svenweb.mimetype" type="hidden" value="text/csv+hbmp" /> <input type="submit" /> </form> </body></html>""" % (content) return Response(html)
def render(self, req, content): html = ( """ <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("td").click(go); }); %s </script></head><body>""" % lib_js() ) html += draw(req, content, self.props) html += "</body></html>" return Response(html)