 
 bind_button_urls = ->
   $("[data-button-url]").on "click", ->
-    window.location = $(this).data("button-url")
+    window.location = $(@).data("button-url")
     false
 
 bind_datepicker = ->

        $opt_el.show()

$.fn.bind_checkboxes_clone = ->
  $el = $($(this).data("checkboxes-clone"))
  $new_id = $(this).data("checkboxes-clone-into")

  $str = $el.concat_checkbox_text()
  $new_el = $("<div class='controls' id='#{$new_id}' style='margin-top: 5px;'></div>").hide()

  $(".form-vertical").removeClass("form-horizontal")

  $("[data-nicedit]").each ->
    new nicEditor().panelInstance($(@).attr("id"))

  $("[data-checkboxes-clone]").each ->
    $(@).bind_checkboxes_clone()
  $("[data-collapsible-label]").each ->
    $(@).bind_collapsible_label()

  $("[data-boolean-value]").each ->
    $(@).bind_boolean_value()

  $("[data-active-select]").each ->
    $url = $(@).data("active-select")
    $(@).on
      change: ->
        $to_url = $url.replace /__template__/, $(@).val()
        window.location = $to_url

  $("[data-token-input]").each ->
    $(@).tokenInput $(@).data("token-input"),
      theme: "facebook"
      prePopulate: $(@).data("token-pre")
      preventDuplicates: true
      crossDomain: false
      hintText: $(@).data("token-hint-text")
      noResultsText: $(@).data("token-no-results-text")
      searchingText: $(@).data("token-searching-text")

  $("#flash_panel").delay(3000).fadeOut 3000

