<commit_before>
/* Top toolbar area with buttons and title
----------------------------------------------------------------------------------------------------------------------*/
// TODO: rename all header-related things to "toolbar"

function ClipBoard(calendar, options) {
  var t = this;

  // exports
  t.render = render;
  t.destroy = destroy;
  t.eventDropped = eventDropped;
  t.removeEvent = removeEvent;
  t.getClipBoardElement = getClipBoardElement;
  //t.renderClipboardEvents = renderClipboardEvents;

  //locals
  var clipBoardElement
  var clipBoardEvents = options.clipboardEvents

  bindCollectionEvents()

  function bindCollectionEvents() {
    clipBoardEvents.bind('reset', renderClipboardEvents)
  }

  function render(el) {
    clipBoardElement = '<div class="dropdown">'
    clipBoardElement += '<a class="dropdown-toggle" role="button" data-toggle="dropdown" data-target="#" href="#">'
    clipBoardElement += '<i class="fa-icon icon-paper-clip"></i>'
    clipBoardElement += '<i class="fa-icon icon-caret-down"></i>'
    clipBoardElement += '</a>'
    clipBoardElement += '<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"></ul>'
    clipBoardElement += '<div class="notification" style="display: block;"></div>'
    clipBoardElement += '</div>'
    clipBoardElement = $(clipBoardElement)
    el.find(".fc-right").prepend(clipBoardElement)
  }

  function getClipBoardElement() {
    return clipBoardElement
  }

  function destroy() {

  }

  function eventDropped(event) {
    calendar.trigger("moveEventToClipboard", clipBoardEvents, event)
  }

  function removeEvent(event) {

  }

  function eventDrag(ev) {
    var cbEvent = ev.data.cbEvent
    var view = calendar.getView()
    var grid = view.dayGrid || view.timeGrid
    var dropDate
    var dropCol
    var mouseFollower = new MouseFollower($(this), {
      parentEl: view.calendar.getElement(),
      opacity: view.opt('dragOpacity'),
      revertDuration: view.opt('dragRevertDuration'),
      zIndex: 10 // one above the .fc-view
    });
    var dragListener = new DragListener(view.coordMap, {
      listenStart: function(ev) {
        mouseFollower.start(ev);
      },
      cellOver: function(cell, date) {
        var newStart = date.clone()
        var newEnd = date.clone().add(cbEvent.clipboard_duration, 'minutes')
        var seg = null
        dropDate = date;
        dropCol = cell.col
        var mockEvent = view.renderDrag(newStart, newEnd, seg, dropCol)
        mouseFollower.show();
      },
      cellOut: function() {
        dropDate = null;
        dropCol = null;
        view.destroyDrag();
      },
      listenStop: function() {
        view.destroyDrag();
        mouseFollower.stop();
        var newResource = calendar.getResources()[dropCol]
        calendar.trigger("clipBoardEventDropped", dropDate, newResource, cbEvent)<commit_msg>fixed clipboard event fropped trigger - now passes the correct arguments + some minor varible renaming<commit_after>
/* Top toolbar area with buttons and title
----------------------------------------------------------------------------------------------------------------------*/
// TODO: rename all header-related things to "toolbar"

function ClipBoard(calendar, options) {
  var t = this;

  // exports
  t.render = render;
  t.destroy = destroy;
  t.eventDropped = eventDropped;
  t.removeEvent = removeEvent;
  t.getClipBoardElement = getClipBoardElement;
  //t.renderClipboardEvents = renderClipboardEvents;

  //locals
  var clipBoardElement
  var clipBoardEvents = options.clipboardEvents

  bindCollectionEvents()

  function bindCollectionEvents() {
    clipBoardEvents.bind('reset', renderClipboardEvents)
  }

  function render(el) {
    clipBoardElement = '<div class="dropdown">'
    clipBoardElement += '<a class="dropdown-toggle" role="button" data-toggle="dropdown" data-target="#" href="#">'
    clipBoardElement += '<i class="fa-icon icon-paper-clip"></i>'
    clipBoardElement += '<i class="fa-icon icon-caret-down"></i>'
    clipBoardElement += '</a>'
    clipBoardElement += '<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"></ul>'
    clipBoardElement += '<div class="notification" style="display: block;"></div>'
    clipBoardElement += '</div>'
    clipBoardElement = $(clipBoardElement)
    el.find(".fc-right").prepend(clipBoardElement)
  }

  function getClipBoardElement() {
    return clipBoardElement
  }

  function destroy() {

  }

  function eventDropped(event) {
    calendar.trigger("moveEventToClipboard", clipBoardEvents, event)
  }

  function removeEvent(event) {

  }

  function eventDrag(ev) {
    var cbEvent = ev.data.cbEvent;
    var view = calendar.getView();
    var grid = view.dayGrid || view.timeGrid;
    var dropStartTime;
    var dropFinishTime;
    var dropCol;
    var mouseFollower = new MouseFollower($(this), {
      parentEl: view.calendar.getElement(),
      opacity: view.opt('dragOpacity'),
      revertDuration: view.opt('dragRevertDuration'),
      zIndex: 10 // one above the .fc-view
    });
    var dragListener = new DragListener(view.coordMap, {
      listenStart: function(ev) {
        mouseFollower.start(ev);
      },
      cellOver: function(cell, date) {
        dropStartTime = cell.date.clone()
        dropFinishTime = date.clone().add(cbEvent.clipboard_duration, 'minutes')
        var seg = null
        dropCol = cell.col
        var mockEvent = view.renderDrag(dropStartTime, dropFinishTime, seg, dropCol)
        mouseFollower.show();
      },
      cellOut: function() {
        dropStartTime = null;
        dropFinishTime = null;
        dropCol = null;
        view.destroyDrag();
      },
      listenStop: function() {
        view.destroyDrag();
        mouseFollower.stop();
        var newResource = calendar.getResources()[dropCol]
        calendar.trigger("clipBoardEventDropped", this, dropStartTime, dropFinishTime, newResource, cbEvent, this)
{'fraction_non_alphanumeric': 0.16210739614994935, 'fraction_numerical': 0.0006754474839581223, 'mean_word_length': 2.858631921824104, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '717262', 'n_tokens_mistral': 1704, 'n_tokens_neox': 1649, 'n_words': 367}