示例#1
0
文件: Bs.py 项目: pygics-mod/bootpage
 def html(self, *elems):
     for elem in elems:
         if not self._carousel_inner:
             self._carousel_inner.html(elem)
             if self._carousel_indicator != None:
                 self._carousel_indicator.html(W3.Li(**{'data-target' : '#' + self._carousel_id, 'data-slide-to' : '%d' % self._carousel_count}))
         else:
             self._carousel_inner.html(elem.attr(Class='active'))
             if self._carousel_indicator != None:
                 self._carousel_indicator.html(W3.Li(**{'class' : 'active', 'data-target' : '#' + self._carousel_id, 'data-slide-to' : '%d' % self._carousel_count}))
     return self
示例#2
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, button=Button(), **attrs):
     W3.Div.__init__(self, **attrs)
     self.baseattr(Class='dropdown')
     button.attr(**{'class' : 'dropdown-toggle', 'data-toggle' : 'dropdown', 'aria-haspopup' : 'true', 'aria-expanded' : 'false'})
     self['elems'].append(button)
     self._dropdown_menu = W3.Div(Class='dropdown-menu')
     self['elems'].append(self._dropdown_menu)
示例#3
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, prev=Carousel.Prev(), next=Carousel.Next(), indicator=Carousel.Indicator(), **attrs):
     W3.Div.__init__(self, **attrs)
     self._carousel_id = createVid()
     self.baseattr(**{'id' : self._carousel_id, 'class' : 'carousel slide', 'data-ride' : 'carousel'})
     self._carousel_indicator = indicator
     self._carousel_count = 0
     self._carousel_inner = W3.Div(Class='carousel-inner')
     if indicator != None: self['elems'].append(self._carousel_indicator)
     self['elems'].append(self._carousel_inner)
     if prev != None: self['elems'].append(prev.attr(Href='#' + self._carousel_id))
     if next != None: self['elems'].append(next.attr(Href='#' + self._carousel_id))
示例#4
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, size, scr=None, **attrs): W3.Div__init__(self, **attrs); self.baseattr(Class='col-%s-%d' % (scr, size) if scr else 'col-%d' % size)
 
 XSMALL = None
示例#5
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, tag, inline=False, **attrs):
     W3.Div.__init__(self, Class='form-check form-check-inline' if inline else 'form-check')
     self._radio_label = W3.Label(**attrs).baseattr(Class='form-check-label').html(tag)
     self['elems'].append(self._radio_label)
示例#6
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, src, **attrs):
     W3.Div.__init__(self, **attrs);
     self.baseattr(Class='carousel-item')
     self.html(W3.Img(Src=src))
示例#7
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, **attrs):
     W3.A.__init__(self, **attrs)
     self.baseattr(**{'class' :'carousel-control-next', 'role' : 'button', 'data-slide' : 'next'})
     self.html(W3.Span(**{'class' : 'carousel-control-next-icon', 'aria-hidden' : 'true'}))
示例#8
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, **attrs):
     W3.Nav.__init__(self, **attrs)
     self.baseattr(**{'aria-label' : 'breadcrumb', 'role' : 'navigation'})
     self._breadcrumb_ol = W3.Ol(Class='breadcrumb')
     self._breadcrumb_active = None
     self['elems'].append(self._breadcrumb_ol)
示例#9
0
文件: Bs.py 项目: pygics-mod/bootpage
 def __init__(self, **attrs):
     W3.Button.__init__(self, **attrs)
     self.baseattr(**{'type' : 'button', 'class' : 'close', 'data-dismiss' : 'alert', 'aria-label' : 'Close'})
     self.html(W3.Span(**{'aria-hidden' : 'true'}).html('×'))