PageSourceSearch

https://zan.kz/js/TemplateHelper.js?nocache=639258787942438529

js zan.kz collected 2026-09-24 15:35:38 UTC 4,681 bytes, 136 lines download raw bytes

1var TemplateHelper = new function () {
2	 this.SearchSubmit = function () {
3	     if ($(".form-search-tmp").length < 1)
4	         return false;
5	 	 CommonHelper.ShowLoader();
6	 	 var formData = $(".form-search-tmp").serialize();
7	 	 $.ajax({
8	 	     url: '/' + languageUI + '/Template/Index',
9	 	     method: 'post',
10	 	     data: formData
11	 	 }).done(function (output) {
12	 	     $(".search-result-container").html(output);
13               CommonHelper.HideLoader();
14	 	     $('.pagination').pagination({
15	 	         prevText: '<',
16	 	         nextText: '>',
17	 	         currentPage: $(".current-page").val(),
18	 	         items: $(".total").val(),
19	 	         itemsOnPage: 10,
20	 	         cssStyle: 'light-theme',
21	 	         onPageClick: function (pageNumber, event) {
22	 	             $(".current-page").val(pageNumber);
23	 	             TemplateHelper.SearchSubmit();
24	 	         }
25	 	     });
26             });
27         TemplateHelper.SearchFilter();	 	 
28         $(".advanced-search").hide("slow");
29	 	 return false;
30    }
31
32    this.SearchFilter = function () {
33        var formData = $(".form-search-tmp").serialize();
34        $.ajax({
35            url: '/' + languageUI + '/Template/SearchFilter',
36            method: 'post',
37            data: formData
38        }).done(function (filter) {
39            DocumentHelper.FilterInsert(filter.classifiers, 'filter-classifiers', 'classifier', '');
40            DocumentHelper.FilterInsert(filter.languages, 'filter-language', 'language', '');
41
42            CommonHelper.HideLoader();
43            $('.i-checks').iCheck({
44                checkboxClass: 'icheckbox_square-green',
45                radioClass: 'iradio_square-green',
46            });
47            CommonHelper.CheckOnSelect('check-language', 'selectedLanguage', 'unselectedLanguage', true, true, TemplateHelper.SearchSubmit, TemplateHelper.SearchFilter);
48            CommonHelper.CheckOnSelect('check-classifier', 'selectedClassifier', 'unselectedClassifier', true, true, TemplateHelper.SearchSubmit, TemplateHelper.SearchFilter);
49        });
50    }
51
52    this.ResetSearch = function () {
53        window.location.reload(true);
54    }
55
56    this.ReturnSearchUrl = function () {
57        window.location.href = '/' + languageUI + '/Template/Index';
58    }
59
60	this.DownloadPdf = function () {
61	 	 $window = $(".doc-window-1");
62	 	 var id = $window.find(".id").val();
63	 	 window.location.href = '/' + languageUI + '/Template/DownloadPdf?documentId=' + id;
64	 }
65
66    this.DownloadWord = function () {
67        $window = $(".doc-window-1");
68        var id = $window.find(".id").val();
69        window.location.href = '/' + languageUI + '/Template/DownloadWord?documentId=' + id;
70    }
71
72	this.Print = function () {
73	 	 $window = $(".doc-window-1");
74	 	 var id = $window.find('.id').val();
75	 	 $.ajax({
76	 	 	 url: "/" + languageUI + "/Template/GetBodyForPrint/",
77	 	 	 method: "GET",
78	 	 	 async: true,
79	 	 	 data: { id: id }
80	 	 }).done(function (output) {
81               var mywindow = window.open('', '_BLANK', '');
82               mywindow.document.write(output);
83               mywindow.document.close();
84               mywindow.focus();
85               setTimeout(function () {
86                   mywindow.print();
87                   mywindow.close();
88               }, 200);
89	 	 });
90	 	 return true;
91	 }
92
93    this.FontSizeInc = function () {
94	 	 var $window = $(".doc-window-1" );
95	 	 var $p = $window.find(".doc-body p");
96	 	 var fontSize = parseInt($p.css("font-size")) + 1;
97	 	 $p.css("font-size", fontSize + "px");
98	 }
99
100	this.FontSizeDec = function () {
101	 	 var $window = $(".doc-window-1");
102	 	 var $p = $window.find(".doc-body p");
103	 	 var fontSize = parseInt($p.css("font-size")) - 1;
104
105	 	 $p.css("font-size", fontSize + "px");
106	 }
107
108	this.GetBody = function () {
109	 	 CommonHelper.ShowLoader();
110	 	 var id = $(".tmp-id").val();
111	 	 $.ajax({
112	 	 	 url: "/" + languageUI + "/Template/GetBody/",
113	 	 	 method: "GET",
114	 	 	 async: true,
115	 	 	 data: { id: id }
116	 	 }).done(function (output) {
117	 	 	 var $docBody = $(".doc-window-1").find(".doc-body");
118	 	 	 $docBody.html(output);
119	 	 	
120	 	 });
121	 	 CommonHelper.HideLoader();
122    }
123
124    this.TextWidth = function (isFullWidth) {
125        var $div = $(".doc-detail");
126        var textWidth = isFullWidth == true ? "80" : isFullWidth == false ? "100" : $("#textWidth").val();
127        if (textWidth == "100") {
128            $div.css('width', '80%');
129            $("#textWidth").val('80');
130        }
131        else {
132            $div.css('width', '100%');
133            $("#textWidth").val('100');
134        }
135    }
136}

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.