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):
21
25
28
30
31 - def __init__(self, text='', _doc=None):
32 self._e = DOM.createElement('style')
33 self._e.setAttribute('type', 'text/css')
34 setStyleElementText(self._e, text)
35
36 if _doc is None:
37 _doc = doc()
38 _doc.getElementsByTagName("head").item(0).appendChild(self._e)
39
41 parent = DOM.getParent(self._e)
42 DOM.removeChild(parent, self._e)
43