PageSourceSearch

https://paraio.org/js/main.js?v=5

js paraio.org collected 2026-10-02 10:24:52 UTC 3,563 bytes, 144 lines download raw bytes

1
2$(".api-body").hide();
3$("a.collapse-expand-link").click(function () {
4	$('.api-body').toggle();
5	return false;
6});
7
8// Collapsible articles
9$("article").each(function () {
10	var that = $(this);
11	var header = that.children("a");
12	var body = that.children(".api-body");
13	header.click(function (argument) {
14		body.toggle();
15		return false;
16	});
17});
18
19// Expanding the article on link click and scrolling down to it
20$("#sidebar a").each(function () {
21	var that = $(this);
22	var id = that.attr("href").substring(that.attr("href").indexOf("#") + 1);
23	that.click(function (e) {
24		if (id) {
25			var header = $("a#" + id);
26			if (header && header.offset()) {
27				$("html, body").animate({scrollTop: header.offset().top}, "fast");
28			}
29		}
30	});
31});
32
33
34/// TEXT ROTATOR
35$.fn.extend({
36	rotaterator: function (options) {
37		var defaults = {
38			fadeSpeed: 500,
39			pauseSpeed: 1000,
40			child: null
41		};
42		var options = $.extend(defaults, options);
43
44		return this.each(function () {
45			var o = options;
46			var obj = $(this);
47			var items = $(obj.children(), obj);
48			items.each(function () {
49				$(this).hide();
50			});
51			if (!o.child) {
52				var next = $(obj).children(':first');
53			} else {
54				var next = o.child;
55			}
56			$(next).fadeIn(o.fadeSpeed, function () {
57				$(next).delay(o.pauseSpeed).fadeOut(o.fadeSpeed, function () {
58					var next = $(this).next();
59					if (next.length === 0) {
60						next = $(obj).children(':first');
61					}
62					$(obj).rotaterator({child: next, fadeSpeed: o.fadeSpeed, pauseSpeed: o.pauseSpeed});
63				});
64			});
65		});
66	}
67});
68
69$(".intro-text").rotaterator({fadeSpeed: 150, pauseSpeed: 2000});
70
71function saveSettings(obj) {
72	window.localStorage.setItem('para-docs', JSON.stringify(obj));
73};
74function loadSettings() {
75	return JSON.parse(window.localStorage.getItem('para-docs') || '{}');
76};
77function setTheme(t) {
78	var href, logohref, theme;
79	var settings = loadSettings();
80	if (t) {
81		theme = t;
82	} else {
83		theme = settings.theme === 'light' ? 'dark' : 'light';
84	}
85	if (theme === 'light') {
86		href = "css/main.css";
87		logohref = "/img/logo.svg";
88		settings.theme = 'light';
89		$('#dark-theme').remove();
90		$("#theme-switch-btn").text("Dark Theme");
91	} else {
92		href = "css/dark.css";
93		logohref = "/img/logodark.svg";
94		settings.theme = 'dark';
95		$("#theme-switch-btn").text("Light Theme");
96		$('#theme').after('<link href="/css/dark.css?v=5" rel="stylesheet" id="dark-theme">');
97	}
98	saveSettings(settings);
99	$('#logo').attr('src', logohref);
100};
101
102$("#theme-switch-btn").click(function () {
103	setTheme();
104	return false;
105});
106
107var settings = loadSettings();
108
109setTheme(settings.theme || ($("#dark-matter").is(":visible") ? 'dark' : 'light')); // auto-detect with CSS queries
110
111if (settings.expandedCategories) {
112	$(Object.keys(settings.expandedCategories).join(',')).collapse();
113}
114
115$("a.docs-category").click(function () {
116	if (!settings.expandedCategories) {
117		settings.expandedCategories = {};
118	}
119	if ($(this).attr("aria-expanded") === "false") {
120		settings.expandedCategories[$(this).attr("href")] = 1;
121	} else {
122		delete settings.expandedCategories[$(this).attr("href")];
123	}
124	saveSettings(settings);
125});
126
127$(".docs-category-child a").click(function () {
128	if (window.matchMedia('(max-width: 767px)').matches) {
129		$('#dismiss').click();
130	}
131});
132
133$(".wrapper").fadeIn(100);
134
135$("#sidebar").mCustomScrollbar({
136	theme: "minimal"
137});
138
139$('#sidebarCollapse, #dismiss').on('click', function () {
140	$('#sidebar, #content').toggleClass('active');
141//	$('.collapse.in').toggleClass('in');
142//	$('a[aria-expanded=true]').attr('aria-expanded', 'false');
143	return false;
144});

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.