PageSourceSearch

https://www.nic.ad.jp/common/js/plugins.js

js nic.ad.jp collected 2026-10-01 08:34:19 UTC 3,589 bytes, 118 lines download raw bytes

1// usage: log('inside coolFunc', this, arguments);
2// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
3window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; try { args.callee = f.caller } catch(e) {}; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}};
4
5// make it safe to use console.log always
6(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}})
7(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}());
8
9
10
11/*!
12 * jQuery Cookie Plugin v1.3.0
13 * https://github.com/carhartl/jquery-cookie
14 *
15 * Copyright 2013 Klaus Hartl
16 * Released under the MIT license
17 */
18(function ($, document, undefined) {
19
20	var pluses = /\+/g;
21
22	function raw(s) {
23		return s;
24	}
25
26	function decoded(s) {
27		return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
28	}
29	
30	function unRfc2068(value) {
31		if (value.indexOf('"') === 0) {
32			// This is a quoted cookie as according to RFC2068, unescape
33			value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
34		}
35		return value;
36	}
37
38	var config = $.cookie = function (key, value, options) {
39
40		// write
41		if (value !== undefined) {
42			options = $.extend({}, config.defaults, options);
43
44			if (value === null) {
45				options.expires = -1;
46			}
47
48			if (typeof options.expires === 'number') {
49				var days = options.expires, t = options.expires = new Date();
50				t.setDate(t.getDate() + days);
51			}
52
53			value = config.json ? JSON.stringify(value) : String(value);
54
55			return (document.cookie = [
56				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
57				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
58				options.path    ? '; path=' + options.path : '',
59				options.domain  ? '; domain=' + options.domain : '',
60				options.secure  ? '; secure' : ''
61			].join(''));
62		}
63
64		// read
65		var decode = config.raw ? raw : decoded;
66		var cookies = document.cookie.split('; ');
67		var result = key ? null : {};
68		for (var i = 0, l = cookies.length; i < l; i++) {
69			var parts = cookies[i].split('=');
70			var name = decode(parts.shift());
71			var cookie = decode(parts.join('='));
72			
73			if (config.json) {
74				cookie = JSON.parse(cookie);
75			}
76			
77			if (key && key === name) {
78				result = cookie;
79				break;
80			}
81			
82			if (!key) {
83				result[name] = cookie;
84			}
85		}
86
87		return result;
88	};
89
90	config.defaults = {};
91
92	$.removeCookie = function (key, options) {
93		if ($.cookie(key) !== null) {
94			$.cookie(key, null, options);
95			return true;
96		}
97		return false;
98	};
99
100})(jQuery, document);
101
102
103// Anchor scrolling
104;(function($){
105	$.fn.scrollAnchors = function(options) {
106	  var settings = { duration: 500, easing: "swing" };
107	  if (options) $.extend(settings,options);
108	  return $(this).bind("click touchend",function(event) {
109	    event.preventDefault();
110	    var $target = $(this.hash) ;
111	    if(!$target.length) {$target=$("a[name="+ this.hash.slice(1) +"]")} // If the element has a name attribute only.
112	    var target_offset = $target.offset();
113	    var target_top = target_offset.top;
114	    $('html, body').stop().animate({scrollTop:target_top}, settings.duration, settings.easing);
115	    window.location.hash=this.hash;
116	  });
117	}
118})(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.