1 """ CSS Stylesheet messing
2
3 Copyright (C) 2010, Stolati <mickael.kerbrat@gmail.com>
4 Copyright (C) 2010, Luke Kenneth Casson Leighton <lkcl@lkcl.net>
5 """
6
7 from __pyjamas__ import doc
8 from pyjamas import DOM
9
11
12 - def __init__(self, cssFile='', _doc=None):
22
26
29
31
32 - def __init__(self, text='', _doc=None):
33 self._e = DOM.createElement('style')
34 self._e.setAttribute('type', 'text/css')
35 setStyleElementText(self._e, text)
36
37 if _doc is None:
38 _doc = doc()
39 _doc.getElementsByTagName("head").item(0).appendChild(self._e)
40
42 parent = DOM.getParent(self._e)
43 DOM.removeChild(parent, self._e)
44