PageSourceSearch

https://ietty.me/magazine/wp-content/themes/albatros_custom-child/js/scripts.js

js ietty.me collected 2026-09-24 10:43:31 UTC 3,048 bytes, 97 lines download raw bytes

1$(function () {
2
3  // iettyの会員またはログインでのコンテンツ認証
4  var logged_in_user = $('.logged_in_ietty_user');
5  if (logged_in_user.length) {
6    $.ajax({
7      type: 'GET',
8      dataType: 'json',
9      url: location.protocol + '//' + location.host + '/api/v2/logged_in_user/',
10      cache: false,
11    }).done(function (response) {
12      logged_in_user.show();
13    }).fail(function (response) {
14      $.ajax({
15        type: 'POST',
16        url: ietty_logged_in.endpoint,
17        data: {
18          action: ietty_logged_in.action,
19          post_id: ietty_logged_in.post_id
20        },
21      }).done(function (data) {
22        logged_in_user.after(data);
23      });
24    });
25  }
26
27  addCampaignCode();
28  initForm();
29
30  $("#clearSearchRealEstatesForm").bind("click", function () {
31    $(this.form).find("select").val("").end().find(":checked").prop("checked", false);
32    localStorage.clear();
33  });
34});
35
36// added 2016.06.02
37function addCampaignCode() {
38  var path = location.pathname;
39  var target = location.protocol + '//' + location.host;
40  var param = '?utm_source=magazine&utm_medium=magazine&utm_campaign=om_' + path.replace(/\//g, '_').slice(1, -1);
41  var areas = {//地域名キャンペーンコードの対象エリア名
42    'ebisu': true
43  };
44
45  $('a').each(function () {
46    var $elem = $(this);
47    if ($elem[0].href.startsWith(target) && !$elem[0].href.startsWith(target + '/magazine') && $elem[0].href.search('rentty') < 0) {
48      var className = $elem.attr("class");
49      var areaName = className ? className.match(/[^ ]*?(?=_link)/) : "";
50      $elem.attr('href', $elem.attr('href') + (areas[areaName] ?
51        '?utm_source=magazine&utm_medium=magazine&utm_campaign=lp_' + areaName + '_fudosan' : param));
52    }
53  });
54
55  $('.mail_form_action').each(function () {
56    $(this).attr('action', target + '/login/' + param);
57  });
58}
59
60function initForm() {
61  $.each($('#searchRealEstates select'), function () {
62    var inputName = $(this).attr('name');
63    var optionValue = localStorage[inputName];
64    $('[name="' + inputName + '"]').find('option[value="' + optionValue + '"]').attr('selected', true);
65  });
66
67  $.each($('#searchRealEstates input[type=checkbox]'), function () {
68    var inputName = $(this).attr('name');
69    var inputValue = $(this).attr('value');
70    var cbValues = JSON.parse(localStorage.getItem(inputName));
71    if ($.inArray(inputValue, cbValues) != -1) {
72      $(this).attr('checked', 'checked');
73    }
74  });
75
76  bindEvent();
77}
78
79function bindEvent() {
80  $('#searchRealEstates select').change(function () {
81    localStorage.setItem($(this).attr('name'), $(this).val());
82  });
83
84  $('#searchRealEstates input[type=checkbox]').change(function () {
85    var inputName = $(this).attr('name');
86    var inputValue = $(this).attr('value');
87    var cbValues = new Array();
88    $.each($('[name="' + inputName + '"]'), function () {
89      if ($(this).is(':checked')) {
90        cbValues.push($(this).attr('value'));
91      }
92    });
93
94    localStorage.setItem(inputName, JSON.stringify(cbValues));
95  });
96}
97

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.