PageSourceSearch

https://www.hirogin.co.jp/inc/js/polls/opinion_polls_v2.js

js hirogin.co.jp collected 2026-10-01 10:43:01 UTC 1,751 bytes, 62 lines download raw bytes

1/*
2	Copyright Phonogram 2012 All Rights Reserved
3	author: Joe Savona
4	date: 2012/01.19
5 */
6(function($) {
7	var RATES_URL = '/vote/index.php?act=CurrentPollJSON',
8		$pollRoot;
9
10	function initPoll() {
11		$pollRoot = $('#ballot');
12		if ($pollRoot.size()) {
13			$.ajax({
14				url: RATES_URL + '&time=' + getParameterByName('time'),
15				dataType: 'json',
16				type: 'GET',
17				success: onBallotLoad,
18				error: onBallotError
19			});
20		}
21	}
22
23	function onBallotLoad(data, textStatus, $xhr) {
24		$pollRoot.find('h3').text(data.question);
25		$pollRoot.find('label').each(function(index) {
26			$(this).text(data['answer_' + index]).css('cursor','pointer');
27		});
28		$pollRoot.find('form').css('visibility', 'visible').show();
29		$pollRoot.find('form').append('<input type="hidden" name="name" value="' + data.name + '" />');
30		$pollRoot.on('change', ':input:radio', onBallotSelection);
31	}
32
33	function onBallotSelection() {
34		var $submit, 
35			src;
36		$submit = $pollRoot.find('#ballot-btn');
37		if ($submit.size()) {
38			src = $submit.attr('src');
39			src = src.replace('_disabled', '');
40			$submit.removeAttr('disabled').attr('src', src);
41		}
42	}
43
44	function onBallotError($xhr, textStatus, errorMessage) {
45		$pollRoot.find('form').remove().end().find('h4').text('アンケートのデータは読み込めません。');
46	}
47
48	/*URLのクエリパラムからデータを読み取る */
49	var getParameterByName = function(name)
50	{
51		//name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
52		var regexS = "[\\?&]" + name + "=([^&#]*)";
53		var regex = new RegExp(regexS);
54		var results = regex.exec(window.location.href);
55		if(results == null)
56			return "";
57		else
58			return decodeURIComponent(results[1].replace(/\+/g, " "));
59	}
60
61	$(document).ready(initPoll);
62})(jQuery);

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.