<commit_before>NodeView = Backbone.View.extend(
  el: '#content'
  events:
    'click i#none' : 'clickButton'
    'change select#selectbox': 'clickOption'
  initialize: (options) ->
    @node = options.node
    @version = options.version
    key = "click i." + @node.cid
    @events[key] = "clickButton"
    key = 'click a.ajax-node-duplicate-' + @node.cid
    @events[key] = 'duplicateNode'
    _.bindAll this, "render", "addAreaToView", "clickButton", "duplicateNode"
    @nodeTemplate = _.template($("#nodeView").html())
    @nodeTitle = _.template($("#nodeTitle").html())
    @render()
    return
  clickButton: (event) ->
    $('.modal-title').text @node.get('name')
    url = @node.get('links')._self_form
    if @node.attributes.alias is ''
      view = new adminFormView(
        url: url
        triggers: [
          {
            event: "keyup input.alias-source"
            name: "refreshAlias"
            fct: refreshAlias
          }
          {
            event: "blur input.alias-dest"
            name: "stopRefreshAlias"
            fct: stopRefreshAlias
          }
        ]
      )
    else
      view = new adminFormView(url: url)
  duplicateNode: (event) ->
    event.preventDefault() #
    viewContext = this
    $.ajax
      url: @node.get('links')._self_duplicate
      method: 'POST'
      success: (response) ->
        Backbone.history.loadUrl(Backbone.history.fragment)
    return
  render: ->
    title = @nodeTitle(node: @node)
    $(@el).html @nodeTemplate(
      node: @node
      title: title
    )
    $('.js-widget-title', @$el).html $('#generated-title', @$el).html()
    $('.js-widget-panel', @$el).html($('#generated-panel', @$el).html()).show()
    for area of @node.get('areas')
      @addAreaToView(@node.get('areas')[area])
    @addVersionToView()
    if @node.attributes.status.published
      $('.ui-model *', @el).unbind()
      $('.js-widget-panel').hide()
    else
      $("ul.ui-model-areas, ul.ui-model-blocks", @$el).each ->
        refreshUl $(this)<commit_msg>Hide action icon<commit_after>NodeView = Backbone.View.extend(
  el: '#content'
  events:
    'click i#none' : 'clickButton'
    'change select#selectbox': 'clickOption'
  initialize: (options) ->
    @node = options.node
    @version = options.version
    key = "click i." + @node.cid
    @events[key] = "clickButton"
    key = 'click a.ajax-node-duplicate-' + @node.cid
    @events[key] = 'duplicateNode'
    _.bindAll this, "render", "addAreaToView", "clickButton", "duplicateNode"
    @nodeTemplate = _.template($("#nodeView").html())
    @nodeTitle = _.template($("#nodeTitle").html())
    @render()
    return
  clickButton: (event) ->
    $('.modal-title').text @node.get('name')
    url = @node.get('links')._self_form
    if @node.attributes.alias is ''
      view = new adminFormView(
        url: url
        triggers: [
          {
            event: "keyup input.alias-source"
            name: "refreshAlias"
            fct: refreshAlias
          }
          {
            event: "blur input.alias-dest"
            name: "stopRefreshAlias"
            fct: stopRefreshAlias
          }
        ]
      )
    else
      view = new adminFormView(url: url)
  duplicateNode: (event) ->
    event.preventDefault() #
    viewContext = this
    $.ajax
      url: @node.get('links')._self_duplicate
      method: 'POST'
      success: (response) ->
        Backbone.history.loadUrl(Backbone.history.fragment)
    return
  render: ->
    title = @nodeTitle(node: @node)
    $(@el).html @nodeTemplate(
      node: @node
      title: title
    )
    $('.js-widget-title', @$el).html $('#generated-title', @$el).html()
    $('.js-widget-panel', @$el).html($('#generated-panel', @$el).html()).show()
    for area of @node.get('areas')
      @addAreaToView(@node.get('areas')[area])
    @addVersionToView()
    if @node.attributes.status.published
      $('.ui-model *', @el).unbind()
      $('.js-widget-panel').hide()
      $('span.action', @el).hide()
    else
      $("ul.ui-model-areas, ul.ui-model-blocks", @$el).each ->
        refreshUl $(this)
{'fraction_non_alphanumeric': 0.17509823182711198, 'fraction_numerical': 0.0, 'mean_word_length': 2.43133951137321, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5627406', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1324, 'n_words': 249}