<commit_before>/* globals Vue */
/**
 * Private Photo Sharing
 */

// for IE9
if (! window.console) {
  var log = function () {};
  var method_list = "log,info,warn,error,dir,trace,time,timeEnd,group,groupEnd,groupCollapsed";
  method_list.split(",").forEach(function (method) {
    window.console[method] = log;
  });
}

Vue.config({
  delimiters: ["[", "]"]
});

new Vue({
  el: document.body,
  data: {
    photo_detail: {},
    files: []
  },
  methods: {
    stopEvent: function (e) {
      e.stopPropagation();
    },
    cancelEvent: function (e) {
      e.preventDefault();
    },
    drop: function (e) {
      e.preventDefault();

      var files = [].slice.call(e.dataTransfer.files);
      var file_count = files.length;
      files = files.filter(function (file) {
        return file.type === "image/jpeg";
      });
      if (file_count !== files.length) {
        alert("JPEG 画像以外はアップロードできません。");
      }
      this.$data.files.push.apply(this.$data.files, files);

      $("#droparea").removeClass("dragover");
    },
    dragenter: function (e) {
      if ($(e.target).hasClass("droparea")) {
        $("#add-photo-modal").modal("show");
      } else {
        $("#droparea").addClass("dragover");
      }
    },
    dragleave: function () {
      $("#droparea").removeClass("dragover");
    },
    removeFile: function (index) {
      this.$data.files.splice(index, 1);
    }
  }
});<commit_msg>Hide photo-detail-modal when D&D event occurred.<commit_after>/* globals Vue */
/**
 * Private Photo Sharing
 */

// for IE9
if (! window.console) {
  var log = function () {};
  var method_list = "log,info,warn,error,dir,trace,time,timeEnd,group,groupEnd,groupCollapsed";
  method_list.split(",").forEach(function (method) {
    window.console[method] = log;
  });
}

Vue.config({
  delimiters: ["[", "]"]
});

new Vue({
  el: document.body,
  data: {
    photo_detail: {},
    files: []
  },
  methods: {
    stopEvent: function (e) {
      e.stopPropagation();
    },
    cancelEvent: function (e) {
      e.preventDefault();
    },
    drop: function (e) {
      e.preventDefault();

      var files = [].slice.call(e.dataTransfer.files);
      var file_count = files.length;
      files = files.filter(function (file) {
        return file.type === "image/jpeg";
      });
      if (file_count !== files.length) {
        alert("JPEG 画像以外はアップロードできません。");
      }
      this.$data.files.push.apply(this.$data.files, files);

      $("#droparea").removeClass("dragover");
    },
    dragenter: function (e) {
      if ($(e.target).hasClass("droparea")) {
        $("#photo-detail-modal").modal("hide");
        $("#add-photo-modal").modal("show");
      } else {
        $("#droparea").addClass("dragover");
      }
    },
    dragleave: function () {
      $("#droparea").removeClass("dragover");
    },
    removeFile: function (index) {
      this.$data.files.splice(index, 1);
    }
  }
});
{'fraction_non_alphanumeric': 0.19443490209549982, 'fraction_numerical': 0.0013740982480247338, 'mean_word_length': 2.6907477820025347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4961769', 'n_tokens_mistral': 983, 'n_tokens_neox': 987, 'n_words': 162}