Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge `output/css.d/*` into one `output/base.css` [examples/cssauto]

  • Loading branch information...
commit 4279d5a22d3ec1bed94ce1b1337ef200468a0acd 1 parent fa92244
mahomahomaho mahomahomaho authored xtfxme committed
53 examples/cssauto/__main__.py
View
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+TARGETS = [
+ 'cssauto.py',
+]
+
+
+PACKAGE = {
+ 'title': 'cssauto',
+ 'desc': 'CSS autoloading',
+}
+
+
+def setup(targets):
+ '''Setup example for translation, MUST call util.setup(targets).'''
+ util.setup(targets)
+
+
+def translate():
+ '''Translate example, MUST call util.translate().'''
+ util.translate()
+
+
+def install(package):
+ '''Install and cleanup example module. MUST call util.install(package)'''
+ util.install(package)
+
+
+##---------------------------------------##
+# --------- (-: DO NOT EDIT :-) --------- #
+##---------------------------------------##
+
+
+import sys
+import os
+
+
+examples = head = os.path.abspath(os.path.dirname(__file__))
+while os.path.split(examples)[1].lower() != 'examples':
+ examples = os.path.split(examples)[0]
+ if not examples:
+ raise ValueError("Cannot determine examples directory")
+sys.path.insert(0, os.path.join(examples))
+from _examples import util
+sys.path.pop(0)
+
+util.init(head)
+
+setup(TARGETS)
+translate()
+install(PACKAGE)
44 examples/cssauto/cssauto.py
View
@@ -0,0 +1,44 @@
+# Date Time Example
+# Copyright (C) 2009 Yit Choong (http://code.google.com/u/yitchoong/)
+
+import pyjd # dummy in pyjs
+
+from pyjamas.ui.VerticalPanel import VerticalPanel
+from pyjamas.ui.RootPanel import RootPanel
+from pyjamas.ui.TextBox import TextBox
+from pyjamas.ui.Button import Button
+from pyjamas.ui.Calendar import DateField, Calendar, CalendarPopup
+from pyjamas.ui.MonthField import MonthField
+
+
+class App:
+ def onModuleLoad(self):
+
+ text = TextBox()
+ df1 = DateField()
+ df2 = DateField(format='%Y/%m/%d')
+ b = Button("Show Calendar", self)
+ self.cal = Calendar()
+ df3 = MonthField()
+
+ vp = VerticalPanel()
+ vp.setSpacing(10)
+ vp.add(df1)
+ vp.add(b)
+ vp.add(df2)
+ vp.add(df3)
+
+ RootPanel().add(vp)
+
+ def onClick(self, sender):
+ p = CalendarPopup(self.cal)
+ x = sender.getAbsoluteLeft() + 10
+ y = sender.getAbsoluteTop() + 10
+ p.setPopupPosition(x,y)
+ p.show()
+
+if __name__ == '__main__':
+ pyjd.setup("./public/cssauto.html") # dummy in pyjs
+ app = App()
+ app.onModuleLoad()
+ pyjd.run() # dummy in pyjs
2  examples/cssauto/public/css.d/custom-datefield.css
View
@@ -0,0 +1,2 @@
+/* one way to override default look of widget */
+td.calendar-cell-today { background:yellow; }
25 examples/cssauto/public/cssauto.html
View
@@ -0,0 +1,25 @@
+<html>
+ <head>
+ <meta name="pygwt:module" content="cssauto">
+
+
+ <!-- important -->
+ <link rel=stylesheet href="base.css" type="text/css">
+
+ <title>CSS autogenerating example</title>
+
+
+ <!-- second way to override default look of control -->
+ <style>
+ td.calendar-day-cell {
+ background-color: white;
+ }
+ </style>
+
+
+ </head>
+ <body bgcolor="white">
+ Example of .css file which is tied with used module, added to base.css and used.
+ <script language="javascript" src="bootstrap.js"></script>
+ </body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.