from scaffold.core.widget import base_widget class control(base_widget): link = None action = "" includes = [] script = [] facebook = False twitter = True plus = True plus_script = False linkedin_script = False facebook_script = False twitter_script = False size = 'medium' annotation = 'inline' def create(self, url, plus=None, twitter=None, facebook=None, linkedin=None): self.plus = plus if plus: if self.plus_script is False: self.plus_script = True self.includes.append('') if twitter: if self.twitter_script is False: self.twitter_script = True self.footer.append(""" """) if facebook: if self.facebook_script is False: self.facebook_script = True self.footer.append("""
""") return self def url(self, link=None): self.link = link return self def render(self): link = '' self.count += 1 htm = '' if self.twitter: htm += 'Tweet' % self.twitter if self.facebook: htm += '' % self.url if self.link: link = ' data-href="' + self.link + '" ' if self.plus is True: htm += '' return htm