PageSourceSearch

https://www.florsheim.com/shop/customers/resources/js/reviews.js

js florsheim.com collected 2026-10-02 04:29:18 UTC 5,081 bytes, 142 lines download raw bytes

1//Account Detail Power Review
2$(document).ready(function () {
3  if (window.location.pathname.indexOf('accountDetails.html') > 0) {
4		if ($("#main\\:powerReviews").length > 0) {
5	    reloadStars("success");
6		}
7  }
8});
9function reloadStars(data) {
10  var id = parseInt($(".pagination.filled").attr("id"));
11  mobileNav(id)
12  if (data === "success" || data.status === "success") {
13    $(".starTable").map(function () {
14      var radioVal = $(this).find($("input[type=radio]:checked")).val();
15      if (radioVal != null) {
16        fillStars(radioVal);
17      }
18    });
19    $("textarea").map(function () {
20      var productVal = $(this).parent().attr("id").split("-")[0];
21      $("#" + productVal + "-count").html($(this).val().length);
22    });
23    var leftPos = $('#reviewContainer').scrollLeft();
24    toggleWidth();
25    window.addEventListener("resize", toggleWidth);
26    $(document).off('mouseover', '.starRadio');
27    $(document).on('mouseover', '.starRadio', function (e) {
28      var radioVal = $(this).prev($("input[type=radio]")).val();
29      fillStars(radioVal);
30    });
31    $(document).off('mouseup', '.starRadio');
32    $(document).on('mouseup', '.starRadio', function (e) {
33      var radioVal = $(this).prev($("input[type=radio]")).val();
34      fillStars(radioVal);
35    });
36    $(document).off('mouseleave', '.starTable');
37    $(document).on('mouseleave', '.starTable', function (e) {
38      var radioVal = $(this).find($("input[type=radio]:checked")).val();
39      if (radioVal == null) {
40        $(this).find(".starRadio").removeClass("pr-star-v4-100-filled").addClass("pr-star-v4-0-filled");
41      } else {
42        fillStars(radioVal);
43      }
44    });
45    $(document).off('keyup', 'textarea');
46    $(document).on('keyup', 'textarea', function (e) {
47      var productVal = $(this).parent().attr("id").split("-")[0];
48      $("#" + productVal + "-count").html($(this).val().length);
49    });
50    $(document).off('mouseup', '#scrollRight');
51    $(document).on('mouseup', '#scrollRight', function (e) {
52      var leftPos = $('#reviewContainer').scrollLeft();
53      var newValue = leftPos + 416;
54      $("#reviewContainer").animate({scrollLeft: leftPos + 416}, 800);
55      toggleButtons(newValue);
56    });
57    $(document).off('mouseup', '#scrollLeft');
58    $(document).on('mouseup', '#scrollLeft', function (e) {
59      var leftPos = $("#reviewContainer").scrollLeft();
60      var newValue = leftPos - 416;
61      $("#reviewContainer").animate({scrollLeft: leftPos - 416}, 800);
62      toggleButtons(newValue);
63    });
64    $(document).off('mouseup', '.pagination');
65    $(document).on('mouseup', '.pagination', function (e) {
66      var selected = parseInt($(this).attr("id"));
67      mobileNav(selected)
68    });
69    $('#reviewWidth').on('touchstart', function (event) {
70			var id = parseInt($(".pagination.filled").attr("id"));
71			var next = id + 1;
72			var prev = id - 1;
73			var total = parseInt($(".pagination:last").attr("id"));
74			const xClick = event.originalEvent.touches[0].pageX;
75			$(this).one('touchmove', function (event) {
76				const xMove = event.originalEvent.touches[0].pageX;
77				const sensitivityInPx = 7;
78
79				if (Math.floor(xClick - xMove) > sensitivityInPx) {
80					if (next <= total) {
81						mobileNav(next);
82					}
83				} else if (Math.floor(xClick - xMove) < -sensitivityInPx) {
84					if (prev > 0) {
85						mobileNav(prev);
86					}
87				}
88			});
89			$(this).on('touchend', function () {
90				$(this).off('touchmove');
91			});
92    });
93  }
94}
95function mobileNav(id) {
96  $("#reviewWidth").children("div.reviewBlock").removeClass("d-flex").addClass("d-none");
97  $("#reviewWidth").children("div.reviewBlock:nth-child(" + id + ")").removeClass("d-none").addClass("d-flex");
98  $(".pagination").removeClass("filled");
99  $("#" + id).addClass("filled");
100}
101
102function fillStars(radioVal) {
103  var productVal = radioVal.split("-")[0];
104  var rating = radioVal.split("-")[1];
105  for (i = 1; i <= rating; i++) {
106    var tempID = "input[value=" + productVal + "-" + i + "]";
107    $(tempID).next($("label")).removeClass("pr-star-v4-0-filled").addClass("pr-star-v4-100-filled");
108  }
109  for (i = 5; i > rating; i--) {
110    var tempID = "input[value=" + productVal + "-" + i + "]";
111    $(tempID).next($("label")).removeClass("pr-star-v4-100-filled").addClass("pr-star-v4-0-filled");
112  }
113}
114
115function toggleButtons(newValue) {
116  if (newValue <= 0) {
117    $("#scrollLeft").addClass("d-none");
118  } else {
119    $("#scrollLeft").removeClass("d-none");
120  }
121  if (newValue >= ($('#reviewWidth').width() - $('#reviewContainer').width())) {
122    $("#scrollRight").addClass("d-none");
123  } else {
124    $("#scrollRight").removeClass("d-none");
125  }
126}
127
128function toggleWidth() {
129  if ($(window).width() <= 450) {
130    $("#reviewWidth").addClass("overflow-x-scroll overflow-y-hidden hideScroll");
131
132  } else {
133    $("#reviewWidth").removeClass("overflow-x-scroll overflow-y-hidden hideScroll");
134  }
135  var leftPos = $('#reviewContainer').scrollLeft();
136  toggleButtons(leftPos);
137}
138
139
140
141
142

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.