PageSourceSearch

https://irost.org/uploads/irost/assets/js/blind.js

js irost.org collected 2026-10-02 14:54:13 UTC 13,938 bytes, 262 lines download raw bytes

1
2/*
3*  Font Size Plugin
4*/
5(function (e, d, a, g) { var b = "rvFontsize", f = { targetSection: "body", store: false, storeIsDefined: !(typeof store === "undefined"), variations: 7, controllers: { append: true, appendTo: "body", showResetButton: false, template: "" } }; function c(j, i) { var h = this; h.element = j; h.options = e.extend({}, f, i); h._defaults = f; h._name = b; h.init() } c.prototype = { init: function () { var h = this, i = function () { h.defineElements(); h.getDefaultFontSize() }; i(); if (h.options.store === true && !(h.options.storeIsDefined)) { h.dependencyWarning() } }, dependencyWarning: function () { console.warn('When you difine "store: true", store script is required (https://github.com/ramonvictor/rv-jquery-fontsize/blob/master/js/store.min.js)') }, bindControlerHandlers: function () { var h = this; h.$decreaseButton = e(".rvfs-decrease"); if (h.$decreaseButton.length > 0) { h.$decreaseButton.on("click", function (j) { j.preventDefault(); var i = e(this); if (!i.hasClass("disabled")) { var k = h.getCurrentVariation(); if (k > 1) { h.$target.removeClass("rvfs-" + k); h.$target.attr("data-rvfs", k - 1); if (h.options.store === true) { h.storeCurrentSize() } h.fontsizeChanged() } } }) } h.$increaseButton = e(".rvfs-increase"); if (h.$increaseButton.length > 0) { h.$increaseButton.on("click", function (j) { j.preventDefault(); var i = e(this); if (!i.hasClass("disabled")) { var k = h.getCurrentVariation(); if (k < h.options.variations) { h.$target.removeClass("rvfs-" + k); h.$target.attr("data-rvfs", k + 1); if (h.options.store === true) { h.storeCurrentSize() } h.fontsizeChanged() } } }) } h.$resetButton = e(".rvfs-reset"); if (h.$resetButton.length > 0) { h.$resetButton.on("click", function (j) { j.preventDefault(); var i = e(this); if (!i.hasClass("disabled")) { var k = h.getCurrentVariation(); h.$target.removeClass("rvfs-" + k); h.$target.attr("data-rvfs", h.defaultFontsize); if (h.options.store === true) { h.storeCurrentSize() } h.fontsizeChanged() } }) } }, defineElements: function () { var h = this; h.$target = e(h.options.targetSection); if (h.options.controllers.append !== false) { var i = h.options.controllers.showResetButton ? '<a href="#" class="rvfs-reset btn" title="Default font size">A</a>' : ""; var k = h.options.controllers.template, j = ""; h.$appendTo = e(h.options.controllers.appendTo); if (e.trim(k).length > 0) { j = k } else { j = '<div class="btn-group"><a href="#" class="rvfs-decrease btn" title="Decrease font size">A-</a></li>' + i + '<a href="#" class="rvfs-increase btn" title="Increase font size">A+</a></li></div>' } h.$appendTo.html(j); h.bindControlerHandlers() } }, getDefaultFontSize: function () { var h = this, i = h.options.variations; h.defaultFontsize = 0; if (i % 2 === 0) { h.defaultFontsize = (i / 2) + 1 } else { h.defaultFontsize = parseInt((i / 2) + 1, 10) } h.setDefaultFontSize() }, setDefaultFontSize: function () { var h = this; if (h.options.store === true && h.options.storeIsDefined) { var i = store.get("rvfs") || h.defaultFontsize; h.$target.attr("data-rvfs", i) } else { h.$target.attr("data-rvfs", h.defaultFontsize) } h.fontsizeChanged() }, storeCurrentSize: function () { var h = this; if (h.options.storeIsDefined) { store.set("rvfs", h.$target.attr("data-rvfs")) } else { h.dependencyWarning() } }, getCurrentVariation: function () { return parseInt(this.$target.attr("data-rvfs"), 10) }, fontsizeChanged: function () { var h = this, i = h.getCurrentVariation(); h.$target.addClass("rvfs-" + i); if (i === h.defaultFontsize) { h.$resetButton.addClass("disabled") } else { h.$resetButton.removeClass("disabled") } if (i === h.options.variations) { h.$increaseButton.addClass("disabled") } else { h.$increaseButton.removeClass("disabled") } if (i === 1) { h.$decreaseButton.addClass("disabled") } else { h.$decreaseButton.removeClass("disabled") } } }; e.fn[b] = function (i) { var h = this; return h.each(function () { if (!e.data(h, "plugin_" + b)) { e.data(h, "plugin_" + b, new c(h, i)) } }) }; e[b] = function () { var h = e(d); return h.rvFontsize.apply(h, Array.prototype.slice.call(arguments, 0)) } })(jQuery, window, document);
6
7let address = "/uploads/47/irost/assets/";
8
9
10(function ($) {
11    $(document).ready(function () {
12        $(".reset-colors").click(function () {
13            $(".wrapper")
14                .removeClass("website-color-1 website-color-2 website-color-3");
15        });
16        $(".website-color-1").click(function () {
17            $(".wrapper").addClass("website-color-1").removeClass("website-color-2 website-color-3");
18        });
19        $(".website-color-2").click(function () {
20            $(".wrapper").addClass("website-color-2").removeClass("website-color-1 website-color-3");
21        });
22        $(".website-color-3").click(function () {
23            $(".wrapper").addClass("website-color-3").removeClass("website-color-1 website-color-2");
24        });
25    });
26})(jQuery);
27
28
29function hasClass(el, cls) {
30    return el.className && new RegExp("(\\s|^)" + cls + "(\\s|$)").test(el.className);
31}
32var body = document.body.querySelector('.wrapper');
33var demos = document.querySelectorAll(".classes_list a");
34
35[].forEach.call(demos, function (button) {
36    button.addEventListener("click", function () {
37        var c = this.getAttribute("id");
38
39        if ($(this).hasClass('active')) {
40            body.className = "wrapper";
41            $(this).removeClass('active');
42            console.log('remove')
43        } else {
44            console.log('add')
45            body.className = "wrapper " + c;
46            deactiveAllButtons();
47            this.className += " active ";
48        }
49    });
50});
51
52function deactiveAllButtons() {
53    [].forEach.call(demos, function (button) {
54        deactiveButton(button);
55    });
56}
57
58function deactiveButton(elem) {
59    elem.className = elem.className.replace(" active ", "");
60}
61$("#blindness").on("click", function (e) { e.preventDefault(); $("#menu-1").hasClass("menu-1--open") ? ($("#menu-1").removeClass("menu-1--open"), $(".color-back").removeClass("color-back--open")) : ($("#menu-1").addClass("menu-1--open"), $(".color-back").addClass("color-back--open")) }), $(".color-back").on("click", function () { $("#menu-1").removeClass("menu-1--open"), $(".color-back").removeClass("color-back--open") });
62
63
64
65
66var lineHeight;
67var lhClicks = 0;
68$("#addlh").click(function () {
69    lhClicks += 1;
70    $("#sublh").prop("disabled", false);
71    if (lhClicks >= 3) { $(this).prop("disabled", true); }
72    if (texttags && lhClicks <= 3) {
73        texttags.forEach(function (elem) {
74            lineHeight = parseInt($(elem).css("line-height"));
75            lineHeight = lineHeight + 5;
76            $(elem).css("line-height", String(lineHeight) + "px");
77        })
78    }
79});
80$("#sublh").click(function () {
81    lhClicks -= 1;
82    $("#addlh").prop("disabled", false);
83    if (lhClicks <= -2) { $(this).prop("disabled", true); }
84    if (texttags && lhClicks >= -2) {
85        texttags.forEach(function (elem) {
86            lineHeight = parseInt($(elem).css("line-height"));
87            lineHeight = lineHeight - 5;
88            $(elem).css("line-height", String(lineHeight) + "px");
89        })
90    }
91});
92$("#deflh").click(function () {
93    $("#addlh,#sublh").prop("disabled", false);
94    lhClicks = 0;
95    if (texttags) {
96        texttags.forEach(function (elem) {
97            $(elem).css("line-height", "");
98        })
99    }
100});
101
102$("#cur1").click(function () {
103    $('body').css("cursor", "url(/uploads/47/ajums/assets/img/cursor-1.png) , auto");
104});
105$("#cur2").click(function () {
106    $('body').css("cursor", "url(/uploads/47/ajums/assets/img/cursor-2.png) , auto");
107});
108$("#curdef").click(function () {
109    $('body').css("cursor", "");
110});
111$(document).ready(function () {
112    //color blind
113
114    //end color blind
115    $('a[href*="https://]"]').attr('target', '_blank');
116    $('a[href*="https://]').attr('target', '_blank');
117    $.rvFontsize({
118        targetSection: "html",
119        store: false,
120        variations: 7,
121        controllers: {
122            appendTo: ".font-resize",
123            showResetButton: true,
124            template: '<div class="btn-group">' +
125                '<a href="#" class="rvfs-decrease btn">Ø¢-</a>' +
126                '<a href="#" class="rvfs-reset btn">Ø¢</a>' +
127                '<a href="#" class="rvfs-increase btn">Ø¢+</a>' +
128                '</div>'
129        },
130    });
131});
132
133$(document).ready(function () {
134
135    const disabledMenu = document.querySelector('.accessibility__menu');
136    let fontSize = 100;
137    let shbnamAdded = false;
138    const shabnamFonts = `@font-face {font-family: Shabnam;src: url('${address}/fonts/Shabnam-FD.woff') format('woff');font-weight: normal;font-style: normal;font-display: swap;} @font-face {font-family: Shabnam;src: url('${address}/fonts/Shabnam-Bold-FD.woff') format('woff');font-weight: bold;font-style: normal;font-display: swap;} @font-face {font-family: Shabnam;src: url('${address}/fonts/Shabnam-Medium-FD.woff') format('woff');font-weight: 500;font-style: normal;font-display: swap;}`;
139    let sahelAdded = false;
140    const sahelFonts = `@font-face {font-family: Sahel;src: url('${address}/fonts/Sahel-FD.woff') format('woff');font-weight: normal;font-style: normal;font-display: swap;} @font-face {font-family: Sahel;src: url('${address}/fonts/Sahel-Bold-FD.woff') format('woff');font-weight: bold;font-style: normal;font-display: swap;} @font-face {font-family: Sahel;src: url('${address}/fonts/Sahel-SemiBold-FD.woff') format('woff');font-weight: 500;font-style: normal;font-display: swap;}`;
141
142    disabledMenu.addEventListener('click', function (e) {
143        //Making fonts Bigger
144        if (e.target.classList.contains('rvfs-increase')) {
145            fontSize += 5;
146            // document.body.style.fontSize = fontSize + '%';
147            document.documentElement.style.fontSize = fontSize + '%';
148
149        }
150        //Reset fonts 
151        if (e.target.classList.contains('rvfs-reset')) {
152            fontSize = 100;
153            // document.body.style.fontSize = fontSize + '%';
154            document.documentElement.style.fontSize = fontSize + '%';
155
156        }
157        //Making fonts smaller
158        if (e.target.classList.contains('rvfs-decrease')) {
159            fontSize -= 5;
160            // document.body.style.fontSize = fontSize + '%';
161            document.documentElement.style.fontSize = fontSize + '%';
162        }
163        //Mouse bigger
164        if (e.target.id == 'cur1') {
165            document.body.style.cursor = 'url("' + address + 'img/cursor-1.png"), auto';
166        }
167        //Mouse Reset
168        if (e.target.id == 'curdef') {
169            document.body.style.cursor = '';
170        }
171        //Mouse smaller
172        if (e.target.id == 'cur2') {
173            document.body.style.cursor = 'url("' + address + 'img/cursor-2.png"), auto';
174        }
175        
176        //Fonts Change
177        if (e.target.id == 'Sahel') {
178            if (!sahelAdded) {
179                sahelAdded = true;
180                document.querySelector('head  style[data-font="true"]').innerHTML += `<style>${sahelFonts}</style>`;
181            }
182            document.body.style.fontFamily = 'Sahel';
183        }
184        if (e.target.id == 'Vazir') {
185            document.body.style.fontFamily = ' Vazir';
186        }
187        if (e.target.id == 'Shabnam') {
188            if (!shbnamAdded) {
189                shbnamAdded = true;
190                document.querySelector('head style[data-font="true"]').innerHTML += `<style>${shabnamFonts}</style>`;
191            }
192            document.body.style.fontFamily = 'Shabnam';
193        }
194
195
196
197        if (e.target.id == 'bgcolor1') {
198            document.querySelector('.wrapper').style.background = "#fff";
199            $('.sec ').css("background-color", "#fff");
200        }
201        if (e.target.id == 'bgcolor2') {
202            document.querySelector('.wrapper').style.background = "#d8d8d8";
203            $('.sec ').css("background-color", "#d8d8d8");
204        }
205        if (e.target.id == 'bgcolor3') {
206            document.querySelector('.wrapper').style.background = "#333333";
207            $('.sec ').css("background-color", "#333333");
208
209        }
210        if (e.target.id == 'bgcolor4') {
211            document.querySelector('.wrapper').style.background = "#fffedb";
212            $('.sec ').css("background-color", "#fffedb");
213
214        }
215
216    });
217});
218
219var texttags = document.querySelectorAll('.wrapper');
220var wordSpaceing;
221var wsClicks = 0;
222$("#addws").click(function () {
223    wsClicks += 1;
224    $("#subws").prop("disabled", false);
225    if (wsClicks >= 3) { $(this).prop("disabled", true); }
226    if (texttags && wsClicks <= 3) {
227        texttags.forEach(function (elem) {
228            wordSpaceing = parseInt($(elem).css("word-spacing"));
229            wordSpaceing = wordSpaceing + 3;
230            $(elem).css("word-spacing", String(wordSpaceing) + "px");
231        })
232    }
233});
234$("#subws").click(function () {
235    wsClicks -= 1;
236    $("#addws").prop("disabled", false);
237    if (wsClicks <= -1) { $(this).prop("disabled", true); }
238    if (texttags && wsClicks >= -1) {
239        texttags.forEach(function (elem) {
240            wordSpaceing = parseInt($(elem).css("word-spacing"));
241            wordSpaceing = wordSpaceing - 3;
242            $(elem).css("word-spacing", String(wordSpaceing) + "px");
243        })
244    }
245});
246$("#defws").click(function () {
247    wsClicks = 0;
248    $("#addws,#subws").prop("disabled", false);
249    if (texttags) {
250        texttags.forEach(function (elem) {
251            $(elem).css("word-spacing", "");
252        })
253    }
254});
255
256$('#secondary-color').val('#000');
257$('#primary-color').on("change", function (elem) {
258    document.querySelector('head style[data-color="true"]').innerHTML = `:root {--primary-color: ${$('#primary-color').val()} !important;}`;
259})
260$('#secondary-color').on("change", function (elem) {
261    document.querySelector('head style[data-color="true"]').innerHTML += `:root {--secondary-color: ${$('#secondary-color').val()} !important;}`;
262})

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.