<commit_before>package org.dojotoolkit
import org.dojotoolkit.TagLibUtil as Util

class PopOverTagLib {
  static namespace = 'dojo'

  def popOverResources = {attrs, body ->
    out << dojo.require(modules:['dojoui.widget.DropDownButton','dijit.TooltipDialog'])
  }


  def popOver = {attrs, body ->
    def id = attrs.remove("id") ?: "dojo_ui_popover${Util.randomId()}"
    def onOpen = attrs.remove("onOpen") ?: ''
    def activate = attrs.remove("activate") ?: 'click'   // can be click or hover
    def btnClass = attrs.remove("btnClass") ?: ''
    def type = attrs.remove("type") ?: 'button'   // can be button or link    
    def dojoWidget = (type == 'link') ? "dojoui.widget.DropDownButtonLink" : "dojoui.widget.DropDownButton"
    def label = (attrs?.code?.length()) ? message(code:attrs.remove('code')) : attrs.remove('label')    

    out << """
      <div dojoType="${dojoWidget}" id="${id}" activate="${activate}" btnClass="${btnClass}" ${Util.htmlProperties(attrs)}>
          <script type="dojo/method" event="onClick" args="evt">${onOpen}</script>
          <span>${label}...</span>
          <div dojoType="dijit.TooltipDialog" style="display:none" autoFocus="false">
              ${body()}
          </div>
      </div>
    """    
  }

  def closePopOverScript = {attrs, body ->
    def onclick = attrs?.onclick ?: ''
    out << "dijit.byId('${attrs?.popOver}').closeDropDown(); ${onclick}"
  }


  def popOverContent = {attrs, body ->
    attrs.style = "${attrs?.style}; display:none;"
    out << """
      <div ${Util.htmlProperties(attrs)}>${body()}</div>      
    """<commit_msg>Removed the three dots added to the label. While this is a good convention.. it should not be forced in the plugin.<commit_after>package org.dojotoolkit
import org.dojotoolkit.TagLibUtil as Util

class PopOverTagLib {
  static namespace = 'dojo'

  def popOverResources = {attrs, body ->
    out << dojo.require(modules:['dojoui.widget.DropDownButton','dijit.TooltipDialog'])
  }


  def popOver = {attrs, body ->
    def id = attrs.remove("id") ?: "dojo_ui_popover${Util.randomId()}"
    def onOpen = attrs.remove("onOpen") ?: ''
    def activate = attrs.remove("activate") ?: 'click'   // can be click or hover
    def btnClass = attrs.remove("btnClass") ?: ''
    def type = attrs.remove("type") ?: 'button'   // can be button or link    
    def dojoWidget = (type == 'link') ? "dojoui.widget.DropDownButtonLink" : "dojoui.widget.DropDownButton"
    def label = (attrs?.code?.length()) ? message(code:attrs.remove('code')) : attrs.remove('label')    

    out << """
      <div dojoType="${dojoWidget}" id="${id}" activate="${activate}" btnClass="${btnClass}" ${Util.htmlProperties(attrs)}>
          <script type="dojo/method" event="onClick" args="evt">${onOpen}</script>
          <span>${label}</span>
          <div dojoType="dijit.TooltipDialog" style="display:none" autoFocus="false">
              ${body()}
          </div>
      </div>
    """    
  }

  def closePopOverScript = {attrs, body ->
    def onclick = attrs?.onclick ?: ''
    out << "dijit.byId('${attrs?.popOver}').closeDropDown(); ${onclick}"
  }


  def popOverContent = {attrs, body ->
    attrs.style = "${attrs?.style}; display:none;"
    out << """
      <div ${Util.htmlProperties(attrs)}>${body()}</div>      
    """
{'fraction_non_alphanumeric': 0.18596915633504688, 'fraction_numerical': 0.0, 'mean_word_length': 3.346911957950066, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6198342', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1080, 'n_words': 219}