<commit_before>var milkcocoa = new MilkCocoa("noteibxtd2w3.mlkcca.com");

var lpmDataStore = milkcocoa.dataStore('LostProperty');
var nameTextArea, categoryArea, addressRadioArea0, addressRadioArea1, addressRadioArea2, addTextArea, board, resultTable,latArea,lngArea, addrMapArea;
var lpcount, page, tr, markers,resultMap, allDataMap;


window.onload = function(){
  markers = new Array();
  alldatas = new Array();
  allDataMap = new google.maps.Map(document.getElementById("alldata_map"), {
    zoom: 8,
    center: new google.maps.LatLng(36.083486, 140.076642),
    scrollwheel: true,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  page = 1;
	nameTextArea = document.getElementById("name");
  addrTextArea = document.getElementById("address");
  resultHeader = document.getElementById("result_p");
  resultTable = document.getElementById('search_result');
  latArea = document.getElementById('id_lat');
  lngArea = document.getElementById('id_lng');
  addrMapArea = document.getElementById('area_name');
  tr = document.getElementsByClassName("main_row");
  $("#null_alert").css("display", "none");
  $("#map_div").css("display", "none");
  $("#result_map").css("display", "none");
  $(".div_pagination").css("text-align", "center");
  $("#page_prev").css("cursor", "pointer");
  $("#page_next").css("cursor", "pointer");
  ShowAllData();
}

// milkcocoa のテストデータを push する
function TestDataPush(name,category,imagePath, pickUpLatitude, pickUpLongitude, pickUpAddress) {
  lpmDataStore.push({name:name, category:category, pickUpLatitude:pickUpLatitude, pickUpLongitude:pickUpLongitude, pickUpAddress
    :pickUpAddress})
}

// 検索結果のテーブルをリセットする
function resultBoardInit() {
  resultTable.innerHTML = "";
}

// 検索条件を表示
function addTextResult(name, cate, addr) {
  resultHeader.innerHTML = "名前[" + name + "] カテゴリー["+ cate + "] 住所[" + addr + "] の検索結果";
}

// 検索結果のテーブルのヘッダーを表示する
function addTableHead() {
  var head = resultTable.insertRow(0);
  head.className = "info";
  var cell1 = document.createElement("th");
  var cell2 = document.createElement("th");
  var cell3 = document.createElement("th");
  cell1.innerHTML = "名前";
  cell2.innerHTML = "カテゴリ";
  cell3.innerHTML = "住所";
  head.appendChild(cell1);
  head.appendChild(cell2);
  head.appendChild(cell3);
}

// 落し物一覧を表示する
function ShowAllData() {
  resultHeader.innerHTML = "落し物一覧";
  var count = 1;
  lpmDataStore.stream().sort("desc").size(999).next(function(err, lpm) {
    addTableHead();
    lpm.forEach(function(lp) {
      addText(lp.value.name, lp.value.category, lp.value.pickUpAddress);
      alldatas.push({position: new google.maps.LatLng(lp.value.pickUpLatitude, lp.value.pickUpLongitude), content: lp.value.name});
      var lpMarker = new google.maps.Marker({
        position: alldatas[count-1].position,
        map: allDataMap<commit_msg>fix: xss in js/search.js (addTextResult)<commit_after>var milkcocoa = new MilkCocoa("noteibxtd2w3.mlkcca.com");

var lpmDataStore = milkcocoa.dataStore('LostProperty');
var nameTextArea, categoryArea, addressRadioArea0, addressRadioArea1, addressRadioArea2, addTextArea, board, resultTable,latArea,lngArea, addrMapArea;
var lpcount, page, tr, markers,resultMap, allDataMap;


window.onload = function(){
  markers = new Array();
  alldatas = new Array();
  allDataMap = new google.maps.Map(document.getElementById("alldata_map"), {
    zoom: 8,
    center: new google.maps.LatLng(36.083486, 140.076642),
    scrollwheel: true,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  page = 1;
	nameTextArea = document.getElementById("name");
  addrTextArea = document.getElementById("address");
  resultHeader = document.getElementById("result_p");
  resultTable = document.getElementById('search_result');
  latArea = document.getElementById('id_lat');
  lngArea = document.getElementById('id_lng');
  addrMapArea = document.getElementById('area_name');
  tr = document.getElementsByClassName("main_row");
  $("#null_alert").css("display", "none");
  $("#map_div").css("display", "none");
  $("#result_map").css("display", "none");
  $(".div_pagination").css("text-align", "center");
  $("#page_prev").css("cursor", "pointer");
  $("#page_next").css("cursor", "pointer");
  ShowAllData();
}

// milkcocoa のテストデータを push する
function TestDataPush(name,category,imagePath, pickUpLatitude, pickUpLongitude, pickUpAddress) {
  lpmDataStore.push({name:name, category:category, pickUpLatitude:pickUpLatitude, pickUpLongitude:pickUpLongitude, pickUpAddress
    :pickUpAddress})
}

// 検索結果のテーブルをリセットする
function resultBoardInit() {
  resultTable.innerHTML = "";
}

// 検索条件を表示
function addTextResult(name, cate, addr) {
  name = escape_html(name);
  cate = escape_html(cate);
  addr = escape_html(addr);
  resultHeader.innerHTML = "名前[" + name + "] カテゴリー["+ cate + "] 住所[" + addr + "] の検索結果";
}

// 検索結果のテーブルのヘッダーを表示する
function addTableHead() {
  var head = resultTable.insertRow(0);
  head.className = "info";
  var cell1 = document.createElement("th");
  var cell2 = document.createElement("th");
  var cell3 = document.createElement("th");
  cell1.innerHTML = "名前";
  cell2.innerHTML = "カテゴリ";
  cell3.innerHTML = "住所";
  head.appendChild(cell1);
  head.appendChild(cell2);
  head.appendChild(cell3);
}

// 落し物一覧を表示する
function ShowAllData() {
  resultHeader.innerHTML = "落し物一覧";
  var count = 1;
  lpmDataStore.stream().sort("desc").size(999).next(function(err, lpm) {
    addTableHead();
    lpm.forEach(function(lp) {
      addText(lp.value.name, lp.value.category, lp.value.pickUpAddress);
      alldatas.push({position: new google.maps.LatLng(lp.value.pickUpLatitude, lp.value.pickUpLongitude), content: lp.value.name});
      var lpMarker = new google.maps.Marker({
        position: alldatas[count-1].position,
        map: allDataMap
{'fraction_non_alphanumeric': 0.15712545676004872, 'fraction_numerical': 0.013572298590568993, 'mean_word_length': 5.386666666666667, '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': '4839459', 'n_tokens_mistral': 2053, 'n_tokens_neox': 2047, 'n_words': 333}